From 272adfdb29c2f06241e14eed56af04dc0e1bfe00 Mon Sep 17 00:00:00 2001 From: toge Date: Tue, 27 Jun 2023 18:03:06 +0900 Subject: [PATCH 01/59] (#18067) minimp3: add version cci.20211201 --- recipes/minimp3/all/conandata.yml | 3 +++ recipes/minimp3/all/conanfile.py | 16 +++++++--------- recipes/minimp3/all/test_package/conanfile.py | 1 + recipes/minimp3/config.yml | 2 ++ 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/recipes/minimp3/all/conandata.yml b/recipes/minimp3/all/conandata.yml index f86679db763b3..f9521b04b54c6 100644 --- a/recipes/minimp3/all/conandata.yml +++ b/recipes/minimp3/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "cci.20211201": + url: "https://github.com/lieff/minimp3/archive/afb604c06bc8beb145fecd42c0ceb5bda8795144.zip" + sha256: "94f847efbb83349ed38dd05888e54bdd8dc6d7bbc3616efd4a1ac899a16bb82e" "20200304": url: "https://github.com/lieff/minimp3/archive/55da78cbeea5fb6757f8df672567714e1e8ca3e9.zip" sha256: "108074684c080a34f0d08f23a709128ea518d48651c8381bce91b73b29185479" diff --git a/recipes/minimp3/all/conanfile.py b/recipes/minimp3/all/conanfile.py index 6886956b3c461..b188314ed0522 100644 --- a/recipes/minimp3/all/conanfile.py +++ b/recipes/minimp3/all/conanfile.py @@ -10,21 +10,21 @@ class Minimp3Conan(ConanFile): name = "minimp3" description = "Minimalistic MP3 decoder single header library." license = "CC0-1.0" - topics = ("minimp3", "decoder", "mp3", "header-only") - homepage = "https://github.com/lieff/minimp3" + topics = ("decoder", "mp3", "header-only") url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/lieff/minimp3" + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True - def package_id(self): - self.info.clear() - def layout(self): basic_layout(self, src_folder="src") + def package_id(self): + self.info.clear() + def source(self): - get(self, **self.conan_data["sources"][self.version], - destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def build(self): pass @@ -35,6 +35,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/minimp3/all/test_package/conanfile.py b/recipes/minimp3/all/test_package/conanfile.py index d120a992c06a6..8a5bb47f50c4c 100644 --- a/recipes/minimp3/all/test_package/conanfile.py +++ b/recipes/minimp3/all/test_package/conanfile.py @@ -7,6 +7,7 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" def requirements(self): self.requires(self.tested_reference_str) diff --git a/recipes/minimp3/config.yml b/recipes/minimp3/config.yml index d49b70495df47..242cda7011c1f 100644 --- a/recipes/minimp3/config.yml +++ b/recipes/minimp3/config.yml @@ -1,4 +1,6 @@ versions: + "cci.20211201": + folder: all "20200304": folder: all "20200221": From a7bef34668d4585e7524ce9d497e77d12e902f16 Mon Sep 17 00:00:00 2001 From: Daniel Heater Date: Tue, 27 Jun 2023 04:22:07 -0500 Subject: [PATCH 02/59] (#18066) Add source code build for CMake 3.26.4 --- recipes/cmake/3.x.x/conandata.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/recipes/cmake/3.x.x/conandata.yml b/recipes/cmake/3.x.x/conandata.yml index 54adb8af58aa6..da33ab402ca26 100644 --- a/recipes/cmake/3.x.x/conandata.yml +++ b/recipes/cmake/3.x.x/conandata.yml @@ -20,3 +20,6 @@ sources: "3.25.2": url: "https://github.com/Kitware/CMake/releases/download/v3.25.2/cmake-3.25.2.tar.gz" sha256: "c026f22cb931dd532f648f087d587f07a1843c6e66a3dfca4fb0ea21944ed33c" + "3.26.4": + url: "https://github.com/Kitware/CMake/releases/download/v3.26.4/cmake-3.26.4.tar.gz" + sha256: "313b6880c291bd4fe31c0aa51d6e62659282a521e695f30d5cc0d25abbd5c208" From 71cabe49fe9f06adf2a62d7e2671f3862555870b Mon Sep 17 00:00:00 2001 From: Simon Jackson Date: Tue, 27 Jun 2023 10:41:51 +0100 Subject: [PATCH 03/59] (#18065) id3v2lib: Fix recipe class name. --- recipes/id3v2lib/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/id3v2lib/all/conanfile.py b/recipes/id3v2lib/all/conanfile.py index 084cf1767bdcf..d920c95d34bde 100644 --- a/recipes/id3v2lib/all/conanfile.py +++ b/recipes/id3v2lib/all/conanfile.py @@ -8,7 +8,7 @@ required_conan_version = ">=1.53.0" -class LibwebmConan(ConanFile): +class Id3v2libConan(ConanFile): name = "id3v2lib" description = "id3v2lib is a library written in C to read and edit id3 tags from mp3 files." topics = ("conan", "id3", "tags", "mp3", "container", "media", "audio") From c22828699bc03aa68b13aaf4cd89c0bbdada43dc Mon Sep 17 00:00:00 2001 From: Matthieu Darbois Date: Tue, 27 Jun 2023 12:02:21 +0200 Subject: [PATCH 04/59] (#18051) libtiff: drop support for versions < 4.3.0 --- recipes/libtiff/all/conandata.yml | 44 -------- recipes/libtiff/all/conanfile.py | 44 ++------ .../4.0.8-0001-cmake-dependencies.patch | 38 ------- .../patches/4.0.8-0002-no-libm-mingw.patch | 13 --- .../4.0.8-0003-file-offsets-bits-mingw.patch | 11 -- .../4.1.0-0001-cmake-dependencies.patch | 85 --------------- .../patches/4.1.0-0002-no-libm-mingw.patch | 13 --- .../4.2.0-0001-cmake-dependencies.patch | 102 ------------------ recipes/libtiff/config.yml | 8 -- 9 files changed, 11 insertions(+), 347 deletions(-) delete mode 100644 recipes/libtiff/all/patches/4.0.8-0001-cmake-dependencies.patch delete mode 100644 recipes/libtiff/all/patches/4.0.8-0002-no-libm-mingw.patch delete mode 100644 recipes/libtiff/all/patches/4.0.8-0003-file-offsets-bits-mingw.patch delete mode 100644 recipes/libtiff/all/patches/4.1.0-0001-cmake-dependencies.patch delete mode 100644 recipes/libtiff/all/patches/4.1.0-0002-no-libm-mingw.patch delete mode 100644 recipes/libtiff/all/patches/4.2.0-0001-cmake-dependencies.patch diff --git a/recipes/libtiff/all/conandata.yml b/recipes/libtiff/all/conandata.yml index b4f27a72cabbe..cc7431489956e 100644 --- a/recipes/libtiff/all/conandata.yml +++ b/recipes/libtiff/all/conandata.yml @@ -11,18 +11,6 @@ sources: "4.3.0": url: "http://download.osgeo.org/libtiff/tiff-4.3.0.tar.gz" sha256: "0e46e5acb087ce7d1ac53cf4f56a09b221537fc86dfc5daaad1c2e89e1b37ac8" - "4.2.0": - url: "http://download.osgeo.org/libtiff/tiff-4.2.0.tar.gz" - sha256: "eb0484e568ead8fa23b513e9b0041df7e327f4ee2d22db5a533929dfc19633cb" - "4.1.0": - url: "http://download.osgeo.org/libtiff/tiff-4.1.0.tar.gz" - sha256: "5d29f32517dadb6dbcd1255ea5bbc93a2b54b94fbf83653b4d65c7d6775b8634" - "4.0.9": - url: "http://download.osgeo.org/libtiff/tiff-4.0.9.tar.gz" - sha256: "6e7bdeec2c310734e734d19aae3a71ebe37a4d842e0e23dbb1b8921c0026cfcd" - "4.0.8": - url: "http://download.osgeo.org/libtiff/tiff-4.0.8.tar.gz" - sha256: "59d7a5a8ccd92059913f246877db95a2918e6c04fb9d43fd74e5c3390dac2910" patches: "4.5.1": - patch_file: "patches/4.5.1-0001-cmake-dependencies.patch" @@ -40,35 +28,3 @@ patches: - patch_file: "patches/4.3.0-0001-cmake-dependencies.patch" patch_description: "CMake: robust handling of dependencies" patch_type: "conan" - "4.2.0": - - patch_file: "patches/4.2.0-0001-cmake-dependencies.patch" - patch_description: "CMake: robust handling of dependencies" - patch_type: "conan" - "4.1.0": - - patch_file: "patches/4.1.0-0001-cmake-dependencies.patch" - patch_description: "CMake: robust handling of dependencies" - patch_type: "conan" - - patch_file: "patches/4.1.0-0002-no-libm-mingw.patch" - patch_description: "port to MINGW: Exclude libm from MINGW since math related functions are already included in libmsvcrt.a" - patch_type: "portability" - patch_source: "https://gitlab.com/libtiff/libtiff/-/merge_requests/73" - "4.0.9": - - patch_file: "patches/4.0.8-0001-cmake-dependencies.patch" - patch_description: "CMake: robust handling of dependencies" - patch_type: "conan" - - patch_file: "patches/4.0.8-0002-no-libm-mingw.patch" - patch_description: "port to MINGW: Exclude libm from MINGW since math related functions are already included in libmsvcrt.a" - patch_type: "portability" - patch_source: "https://gitlab.com/libtiff/libtiff/-/merge_requests/73" - "4.0.8": - - patch_file: "patches/4.0.8-0001-cmake-dependencies.patch" - patch_description: "CMake: robust handling of dependencies" - patch_type: "conan" - - patch_file: "patches/4.0.8-0002-no-libm-mingw.patch" - patch_description: "port to MINGW: Exclude libm from MINGW since math related functions are already included in libmsvcrt.a" - patch_type: "portability" - patch_source: "https://gitlab.com/libtiff/libtiff/-/merge_requests/73" - - patch_file: "patches/4.0.8-0003-file-offsets-bits-mingw.patch" - patch_description: "port to MINGW: enable Large file support by defining _FILE_OFFSET_BITS=64" - patch_type: "portability" - patch_source: "https://gitlab.com/libtiff/libtiff/-/commit/f2a3b020402943f90957552a884788e70ece6cd7" diff --git a/recipes/libtiff/all/conanfile.py b/recipes/libtiff/all/conanfile.py index 4c8c774a41b8a..f44b1722f8755 100644 --- a/recipes/libtiff/all/conanfile.py +++ b/recipes/libtiff/all/conanfile.py @@ -44,30 +44,12 @@ class LibtiffConan(ConanFile): "cxx": True, } - @property - def _has_webp_option(self): - return Version(self.version) >= "4.0.10" - - @property - def _has_zstd_option(self): - return Version(self.version) >= "4.0.10" - - @property - def _has_libdeflate_option(self): - return Version(self.version) >= "4.2.0" - def export_sources(self): export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": del self.options.fPIC - if not self._has_webp_option: - del self.options.webp - if not self._has_zstd_option: - del self.options.zstd - if not self._has_libdeflate_option: - del self.options.libdeflate def configure(self): if self.options.shared: @@ -82,7 +64,7 @@ def layout(self): def requirements(self): if self.options.zlib: self.requires("zlib/1.2.13") - if self.options.get_safe("libdeflate"): + if self.options.libdeflate: self.requires("libdeflate/1.18") if self.options.lzma: self.requires("xz_utils/5.4.2") @@ -94,13 +76,13 @@ def requirements(self): self.requires("mozjpeg/4.1.1") if self.options.jbig: self.requires("jbig/20160605") - if self.options.get_safe("zstd"): + if self.options.zstd: self.requires("zstd/1.5.5") - if self.options.get_safe("webp"): + if self.options.webp: self.requires("libwebp/1.3.0") def validate(self): - if self.options.get_safe("libdeflate") and not self.options.zlib: + if self.options.libdeflate and not self.options.zlib: raise ConanInvalidConfiguration("libtiff:libdeflate=True requires libtiff:zlib=True") def build_requirements(self): @@ -118,14 +100,10 @@ def generate(self): tc.variables["jpeg12"] = False tc.variables["jbig"] = self.options.jbig tc.variables["zlib"] = self.options.zlib - if self._has_libdeflate_option: - tc.variables["libdeflate"] = self.options.libdeflate - if self._has_zstd_option: - tc.variables["zstd"] = self.options.zstd - if self._has_webp_option: - tc.variables["webp"] = self.options.webp - if Version(self.version) >= "4.3.0": - tc.variables["lerc"] = False # TODO: add lerc support for libtiff versions >= 4.3.0 + tc.variables["libdeflate"] = self.options.libdeflate + tc.variables["zstd"] = self.options.zstd + tc.variables["webp"] = self.options.webp + tc.variables["lerc"] = False # TODO: add lerc support for libtiff versions >= 4.3.0 if Version(self.version) >= "4.5.0": # Disable tools, test, contrib, man & html generation tc.variables["tiff-tools"] = False @@ -192,7 +170,7 @@ def package_info(self): self.cpp_info.requires = [] if self.options.zlib: self.cpp_info.requires.append("zlib::zlib") - if self.options.get_safe("libdeflate"): + if self.options.libdeflate: self.cpp_info.requires.append("libdeflate::libdeflate") if self.options.lzma: self.cpp_info.requires.append("xz_utils::xz_utils") @@ -204,9 +182,9 @@ def package_info(self): self.cpp_info.requires.append("mozjpeg::libjpeg") if self.options.jbig: self.cpp_info.requires.append("jbig::jbig") - if self.options.get_safe("zstd"): + if self.options.zstd: self.cpp_info.requires.append("zstd::zstd") - if self.options.get_safe("webp"): + if self.options.webp: self.cpp_info.requires.append("libwebp::libwebp") # TODO: to remove in conan v2 once cmake_find_package* & pkg_config generators removed diff --git a/recipes/libtiff/all/patches/4.0.8-0001-cmake-dependencies.patch b/recipes/libtiff/all/patches/4.0.8-0001-cmake-dependencies.patch deleted file mode 100644 index 7b7979045b5a1..0000000000000 --- a/recipes/libtiff/all/patches/4.0.8-0001-cmake-dependencies.patch +++ /dev/null @@ -1,38 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -544,12 +544,10 @@ endif() - option(jbig "use ISO JBIG compression (requires JBIT-KIT library)" ON) - if (jbig) - set(JBIG_FOUND 0) -- find_path(JBIG_INCLUDE_DIR jbig.h) -- set(JBIG_NAMES ${JBIG_NAMES} jbig libjbig) -- find_library(JBIG_LIBRARY NAMES ${JBIG_NAMES}) -- if (JBIG_INCLUDE_DIR AND JBIG_LIBRARY) -+ find_package(jbig REQUIRED CONFIG) -+ if (1) - set(JBIG_FOUND 1) -- set(JBIG_LIBRARIES ${JBIG_LIBRARY}) -+ set(JBIG_LIBRARIES jbig::jbig) - endif() - endif() - set(JBIG_SUPPORT 0) -@@ -564,7 +562,7 @@ set(CMAKE_REQUIRED_LIBRARIES_SAVE ${CMAKE_REQUIRED_LIBRARIES}) - set(CMAKE_REQUIRED_INCLUDES_SAVE ${CMAKE_REQUIRED_INCLUDES}) - set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${JBIG_INCLUDE_DIR}) - set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${JBIG_LIBRARY}) --check_function_exists(jbg_newlen HAVE_JBG_NEWLEN) -+set(HAVE_JBG_NEWLEN TRUE) - set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES_SAVE}) - set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_SAVE}) - -@@ -701,8 +699,8 @@ endif() - if(ZLIB_LIBRARIES) - list(APPEND TIFF_LIBRARY_DEPS ${ZLIB_LIBRARIES}) - endif() --if(JPEG_LIBRARIES) -- list(APPEND TIFF_LIBRARY_DEPS ${JPEG_LIBRARIES}) -+if(JPEG_FOUND) -+ list(APPEND TIFF_LIBRARY_DEPS JPEG::JPEG) - endif() - if(JPEG12_LIBRARIES) - list(APPEND TIFF_LIBRARY_DEPS ${JPEG12_LIBRARIES}) diff --git a/recipes/libtiff/all/patches/4.0.8-0002-no-libm-mingw.patch b/recipes/libtiff/all/patches/4.0.8-0002-no-libm-mingw.patch deleted file mode 100644 index 216911511380b..0000000000000 --- a/recipes/libtiff/all/patches/4.0.8-0002-no-libm-mingw.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -206,7 +206,9 @@ else() - endif() - - # Find libm, if available --find_library(M_LIBRARY m) -+if (NOT MINGW) -+ find_library(M_LIBRARY m) -+endif() - - check_include_file(assert.h HAVE_ASSERT_H) - check_include_file(dlfcn.h HAVE_DLFCN_H) diff --git a/recipes/libtiff/all/patches/4.0.8-0003-file-offsets-bits-mingw.patch b/recipes/libtiff/all/patches/4.0.8-0003-file-offsets-bits-mingw.patch deleted file mode 100644 index 44a861121db9c..0000000000000 --- a/recipes/libtiff/all/patches/4.0.8-0003-file-offsets-bits-mingw.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -469,7 +469,7 @@ report_values(CMAKE_HOST_SYSTEM_PROCESSOR HOST_FILLORDER - HOST_BIG_ENDIAN HAVE_IEEEFP) - - # Large file support --if (UNIX) -+if (UNIX OR MINGW) - # This might not catch every possibility catered for by - # AC_SYS_LARGEFILE. - add_definitions(-D_FILE_OFFSET_BITS=64) diff --git a/recipes/libtiff/all/patches/4.1.0-0001-cmake-dependencies.patch b/recipes/libtiff/all/patches/4.1.0-0001-cmake-dependencies.patch deleted file mode 100644 index b8a3ec4a4b033..0000000000000 --- a/recipes/libtiff/all/patches/4.1.0-0001-cmake-dependencies.patch +++ /dev/null @@ -1,85 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -489,12 +489,10 @@ endif() - option(jbig "use ISO JBIG compression (requires JBIT-KIT library)" ON) - if (jbig) - set(JBIG_FOUND 0) -- find_path(JBIG_INCLUDE_DIR jbig.h) -- set(JBIG_NAMES ${JBIG_NAMES} jbig libjbig) -- find_library(JBIG_LIBRARY NAMES ${JBIG_NAMES}) -- if (JBIG_INCLUDE_DIR AND JBIG_LIBRARY) -+ find_package(jbig REQUIRED CONFIG) -+ if (1) - set(JBIG_FOUND 1) -- set(JBIG_LIBRARIES ${JBIG_LIBRARY}) -+ set(JBIG_LIBRARIES jbig::jbig) - endif() - endif() - set(JBIG_SUPPORT 0) -@@ -507,7 +505,7 @@ endif() - - set(CMAKE_REQUIRED_INCLUDES_SAVE ${CMAKE_REQUIRED_INCLUDES}) - set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${JBIG_INCLUDE_DIR}) --check_symbol_exists(jbg_newlen "jbig.h" HAVE_JBG_NEWLEN) -+set(HAVE_JBG_NEWLEN TRUE) - set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_SAVE}) - - # liblzma2 -@@ -523,13 +521,11 @@ endif() - # libzstd - option(zstd "use libzstd (required for ZSTD compression)" ON) - if (zstd) -- find_path(ZSTD_INCLUDE_DIR zstd.h) -- find_library(ZSTD_LIBRARY NAMES zstd) -- if (ZSTD_INCLUDE_DIR AND ZSTD_LIBRARY) -- check_library_exists ("${ZSTD_LIBRARY}" ZSTD_decompressStream "" ZSTD_RECENT_ENOUGH) -+ find_package(zstd REQUIRED CONFIG) -+ if (1) -+ set(ZSTD_RECENT_ENOUGH TRUE) - if (ZSTD_RECENT_ENOUGH) - set(ZSTD_FOUND TRUE) -- set(ZSTD_LIBRARIES ${ZSTD_LIBRARY}) - message(STATUS "Found ZSTD library: ${ZSTD_LIBRARY}") - else () - message(WARNING "Found ZSTD library, but not recent enough. Use zstd >= 1.0") -@@ -544,15 +540,13 @@ endif() - # libwebp - option(webp "use libwebp (required for WEBP compression)" ON) - if (webp) -- find_path(WEBP_INCLUDE_DIR /webp/decode.h) -- find_library(WEBP_LIBRARY NAMES webp) -+ find_package(WebP REQUIRED CONFIG) - endif() - set(WEBP_SUPPORT 0) --set(WEBP_FOUND FALSE) --if (WEBP_INCLUDE_DIR AND WEBP_LIBRARY) -+if (WebP_FOUND) - set(WEBP_SUPPORT 1) - set(WEBP_FOUND TRUE) -- set(WEBP_LIBRARIES ${WEBP_LIBRARY}) -+ set(WEBP_LIBRARIES WebP::webp) - message(STATUS "Found WEBP library: ${WEBP_LIBRARY}") - endif() - -@@ -681,8 +675,8 @@ endif() - if(ZLIB_LIBRARIES) - list(APPEND TIFF_LIBRARY_DEPS ${ZLIB_LIBRARIES}) - endif() --if(JPEG_LIBRARIES) -- list(APPEND TIFF_LIBRARY_DEPS ${JPEG_LIBRARIES}) -+if(JPEG_FOUND) -+ list(APPEND TIFF_LIBRARY_DEPS JPEG::JPEG) - endif() - if(JPEG12_LIBRARIES) - list(APPEND TIFF_LIBRARY_DEPS ${JPEG12_LIBRARIES}) -@@ -693,8 +687,8 @@ endif() - if(LIBLZMA_LIBRARIES) - list(APPEND TIFF_LIBRARY_DEPS ${LIBLZMA_LIBRARIES}) - endif() --if(ZSTD_LIBRARIES) -- list(APPEND TIFF_LIBRARY_DEPS ${ZSTD_LIBRARIES}) -+if(ZSTD_FOUND) -+ list(APPEND TIFF_LIBRARY_DEPS $,zstd::libzstd_shared,zstd::libzstd_static>) - endif() - if(WEBP_LIBRARIES) - list(APPEND TIFF_LIBRARY_DEPS ${WEBP_LIBRARIES}) diff --git a/recipes/libtiff/all/patches/4.1.0-0002-no-libm-mingw.patch b/recipes/libtiff/all/patches/4.1.0-0002-no-libm-mingw.patch deleted file mode 100644 index 0fcf8f5711810..0000000000000 --- a/recipes/libtiff/all/patches/4.1.0-0002-no-libm-mingw.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -207,7 +207,9 @@ else() - endif() - - # Find libm, if available --find_library(M_LIBRARY m) -+if (NOT MINGW) -+ find_library(M_LIBRARY m) -+endif() - - check_include_file(assert.h HAVE_ASSERT_H) - check_include_file(dlfcn.h HAVE_DLFCN_H) diff --git a/recipes/libtiff/all/patches/4.2.0-0001-cmake-dependencies.patch b/recipes/libtiff/all/patches/4.2.0-0001-cmake-dependencies.patch deleted file mode 100644 index 7b04f533eb0f4..0000000000000 --- a/recipes/libtiff/all/patches/4.2.0-0001-cmake-dependencies.patch +++ /dev/null @@ -1,102 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -463,12 +463,10 @@ set(ZIP_SUPPORT ${ZLIB_SUPPORT}) - option(libdeflate "use libdeflate (optional for faster Deflate support, still requires zlib)" ON) - if (libdeflate) - set(DEFLATE_FOUND 0) -- find_path(DEFLATE_INCLUDE_DIR libdeflate.h) -- set(DEFLATE_NAMES ${DEFLATE_NAMES} deflate) -- find_library(DEFLATE_LIBRARY NAMES ${DEFLATE_NAMES}) -- if (DEFLATE_INCLUDE_DIR AND DEFLATE_LIBRARY) -+ find_package(libdeflate REQUIRED CONFIG) -+ if (1) - set(DEFLATE_FOUND 1) -- set(DEFLATE_LIBRARIES ${DEFLATE_LIBRARY}) -+ set(DEFLATE_LIBRARIES $,libdeflate::libdeflate,libdeflate::libdeflate_static>) - endif() - endif() - set(LIBDEFLATE_SUPPORT FALSE) -@@ -517,12 +515,10 @@ endif() - option(jbig "use ISO JBIG compression (requires JBIT-KIT library)" ON) - if (jbig) - set(JBIG_FOUND 0) -- find_path(JBIG_INCLUDE_DIR jbig.h) -- set(JBIG_NAMES ${JBIG_NAMES} jbig libjbig) -- find_library(JBIG_LIBRARY NAMES ${JBIG_NAMES}) -- if (JBIG_INCLUDE_DIR AND JBIG_LIBRARY) -+ find_package(jbig REQUIRED CONFIG) -+ if (1) - set(JBIG_FOUND 1) -- set(JBIG_LIBRARIES ${JBIG_LIBRARY}) -+ set(JBIG_LIBRARIES jbig::jbig) - endif() - endif() - set(JBIG_SUPPORT 0) -@@ -535,7 +531,7 @@ endif() - - set(CMAKE_REQUIRED_INCLUDES_SAVE ${CMAKE_REQUIRED_INCLUDES}) - set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${JBIG_INCLUDE_DIR}) --check_symbol_exists(jbg_newlen "jbig.h" HAVE_JBG_NEWLEN) -+set(HAVE_JBG_NEWLEN TRUE) - set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_SAVE}) - - # liblzma2 -@@ -551,14 +547,11 @@ endif() - # libzstd - option(zstd "use libzstd (required for ZSTD compression)" ON) - if (zstd) -- find_path(ZSTD_INCLUDE_DIR zstd.h) -- find_library(ZSTD_LIBRARY NAMES zstd) -- if (ZSTD_INCLUDE_DIR AND ZSTD_LIBRARY) -- check_library_exists ("${ZSTD_LIBRARY}" ZSTD_decompressStream "" ZSTD_RECENT_ENOUGH) -+ find_package(zstd REQUIRED CONFIG) -+ if (1) -+ set(ZSTD_RECENT_ENOUGH TRUE) - if (ZSTD_RECENT_ENOUGH) - set(ZSTD_FOUND TRUE) -- set(ZSTD_LIBRARIES ${ZSTD_LIBRARY}) -- message(STATUS "Found ZSTD library: ${ZSTD_LIBRARY}") - else () - message(WARNING "Found ZSTD library, but not recent enough. Use zstd >= 1.0") - endif () -@@ -572,15 +565,13 @@ endif() - # libwebp - option(webp "use libwebp (required for WEBP compression)" ON) - if (webp) -- find_path(WEBP_INCLUDE_DIR /webp/decode.h) -- find_library(WEBP_LIBRARY NAMES webp) -+ find_package(WebP REQUIRED CONFIG) - endif() - set(WEBP_SUPPORT 0) --set(WEBP_FOUND FALSE) --if (WEBP_INCLUDE_DIR AND WEBP_LIBRARY) -+if (WebP_FOUND) - set(WEBP_SUPPORT 1) - set(WEBP_FOUND TRUE) -- set(WEBP_LIBRARIES ${WEBP_LIBRARY}) -+ set(WEBP_LIBRARIES WebP::webp) - message(STATUS "Found WEBP library: ${WEBP_LIBRARY}") - endif() - -@@ -715,8 +706,8 @@ endif() - if(DEFLATE_LIBRARIES) - list(APPEND TIFF_LIBRARY_DEPS ${DEFLATE_LIBRARIES}) - endif() --if(JPEG_LIBRARIES) -- list(APPEND TIFF_LIBRARY_DEPS ${JPEG_LIBRARIES}) -+if(JPEG_FOUND) -+ list(APPEND TIFF_LIBRARY_DEPS JPEG::JPEG) - endif() - if(JPEG12_LIBRARIES) - list(APPEND TIFF_LIBRARY_DEPS ${JPEG12_LIBRARIES}) -@@ -727,8 +718,8 @@ endif() - if(LIBLZMA_LIBRARIES) - list(APPEND TIFF_LIBRARY_DEPS ${LIBLZMA_LIBRARIES}) - endif() --if(ZSTD_LIBRARIES) -- list(APPEND TIFF_LIBRARY_DEPS ${ZSTD_LIBRARIES}) -+if(ZSTD_FOUND) -+ list(APPEND TIFF_LIBRARY_DEPS $,zstd::libzstd_shared,zstd::libzstd_static>) - endif() - if(WEBP_LIBRARIES) - list(APPEND TIFF_LIBRARY_DEPS ${WEBP_LIBRARIES}) diff --git a/recipes/libtiff/config.yml b/recipes/libtiff/config.yml index fca646b364eb1..961a315dc8eb6 100644 --- a/recipes/libtiff/config.yml +++ b/recipes/libtiff/config.yml @@ -7,11 +7,3 @@ versions: folder: all "4.3.0": folder: all - "4.2.0": - folder: all - "4.1.0": - folder: all - "4.0.9": - folder: all - "4.0.8": - folder: all From 5f37eee93c88195eacbb7a15e17a4ba17421316d Mon Sep 17 00:00:00 2001 From: Raziel Alphadios <64050682+RazielXYZ@users.noreply.github.com> Date: Tue, 27 Jun 2023 13:22:16 +0300 Subject: [PATCH 05/59] (#18020) entt: add version 3.12.2 * entt: add version 3.12.1 * Remove older versions Add cpp_info.names back * Update to 3.12.2 --- recipes/entt/3.x.x/conandata.yml | 60 ++----------------- .../patches/0002-3.12.1-fix-gcc-7.0-7.3.patch | 20 +++++++ recipes/entt/config.yml | 36 +---------- 3 files changed, 28 insertions(+), 88 deletions(-) create mode 100644 recipes/entt/3.x.x/patches/0002-3.12.1-fix-gcc-7.0-7.3.patch diff --git a/recipes/entt/3.x.x/conandata.yml b/recipes/entt/3.x.x/conandata.yml index b55145bf44224..24bd7f949e5dc 100644 --- a/recipes/entt/3.x.x/conandata.yml +++ b/recipes/entt/3.x.x/conandata.yml @@ -1,67 +1,19 @@ sources: + "3.12.2": + url: "https://github.com/skypjack/entt/archive/refs/tags/v3.12.2.tar.gz" + sha256: "3F3E43988218DAECC0530CCAF45E960F7F7416E1FCF2C69799160C18B6A2FEE3" "3.11.1": url: "https://github.com/skypjack/entt/archive/refs/tags/v3.11.1.tar.gz" sha256: "0ac010f232d3089200c5e545bcbd6480cf68b705de6930d8ff7cdb0a29f5b47b" - "3.11.0": - url: "https://github.com/skypjack/entt/archive/refs/tags/v3.11.0.tar.gz" - sha256: "7cca2bd4d4aeef6c5bdbe06b9e047e7f2519ebaff901207cc81ac71a2bbe185e" "3.10.3": url: "https://github.com/skypjack/entt/archive/refs/tags/v3.10.3.tar.gz" sha256: "315918fc678e89a326ce1c13b0e9d3e53882dd9c58a63fef413325917a5c753b" - "3.10.1": - url: "https://github.com/skypjack/entt/archive/refs/tags/v3.10.1.tar.gz" - sha256: "f7031545130bfc06f5fe6b2f8c87dcbd4c1254fab86657e2788b70dfeea57965" - "3.10.0": - url: "https://github.com/skypjack/entt/archive/refs/tags/v3.10.0.tar.gz" - sha256: "4c716cebf4f2964824da158dd58cc81d9f1e056a083538e22fb03ae2d64805ee" - "3.9.0": - url: "https://github.com/skypjack/entt/archive/refs/tags/v3.9.0.tar.gz" - sha256: "1b06f1f6627c3702486855877bdeab6885f5d821d3dd78862126d4308c627c23" - "3.8.1": - url: "https://github.com/skypjack/entt/archive/v3.8.1.tar.gz" - sha256: "a2b767f06bca67a73a4d71fb9ebb6ed823bb5146faad3c282b9dbbbdae1aa01b" - "3.8.0": - url: "https://github.com/skypjack/entt/archive/refs/tags/v3.8.0.tar.gz" - sha256: "71c8ff5a604e8e214571a8b2218dfeaf61be59e2fe2ff5b550b4810c37d4da3c" - "3.7.1": - url: "https://github.com/skypjack/entt/archive/refs/tags/v3.7.1.tar.gz" - sha256: "fe3ce773c17797c0c57ffa97f73902854fcc8e7afc7e09bea373e0c64fa24a23" - "3.7.0": - url: "https://github.com/skypjack/entt/archive/refs/tags/v3.7.0.tar.gz" - sha256: "39ad5c42acf3434f8c37e0baa18a8cb562c0845383a6b4da17fdbacc9f0a7695" - "3.6.0": - url: "https://github.com/skypjack/entt/archive/v3.6.0.tar.gz" - sha256: "94b7dc874acd0961cfc28cf6b0342eeb0b7c58250ddde8bdc6c101e84b74c190" - "3.5.2": - url: "https://github.com/skypjack/entt/archive/v3.5.2.tar.gz" - sha256: "f9271293c44518386c402c9a2188627819748f66302df48af4f6d08e30661036" - "3.5.1": - url: "https://github.com/skypjack/entt/archive/v3.5.1.tar.gz" - sha256: "f442ece6881ec24863e7f0fbdc4bf641e01b0f87955f49dc4687b2fa564e9c83" - "3.5.0": - url: "https://github.com/skypjack/entt/archive/v3.5.0.tar.gz" - sha256: "89cba5ddf90bcec0dcf8d9554d9acf5ad86f5ce305e3acacf795007ee65c93f8" - "3.4.0": - url: "https://github.com/skypjack/entt/archive/v3.4.0.tar.gz" - sha256: "07086b8c5b1d84a1b76b39b0ce257c36c4f1521b77e664368b3d5ca7c00264e2" - "3.3.2": - url: "https://github.com/skypjack/entt/archive/v3.3.2.tar.gz" - sha256: "150cd89b45bffbcd7643d39bbce282e8fa38307bb5ed25567b79e337376ba1c7" - "3.3.1": - url: "https://github.com/skypjack/entt/archive/v3.3.1.tar.gz" - sha256: "432f31a80fb0463960dfd36e103c206dd67f1bfa91fc48408594c28aa790a3f5" - "3.3.0": - url: "https://github.com/skypjack/entt/archive/v3.3.0.tar.gz" - sha256: "d21a45df4960adc86a8f23a8c3c0cea6d2cecc4ef6946a8040e336d8e5266ab3" - "3.2.2": - url: "https://github.com/skypjack/entt/archive/v3.2.2.tar.gz" - sha256: "94592270b6750dd0b057a4af9d2c1ea8798369b3bb127927a8f70db232808f93" patches: - "3.11.1": - - patch_file: "patches/0001-3.11.0-fix-gcc-7.0-7.3.patch" + "3.12.2": + - patch_file: "patches/0002-3.12.1-fix-gcc-7.0-7.3.patch" patch_description: "Fix GCC 7.0 to 7.3" patch_type: "portability" - "3.11.0": + "3.11.1": - patch_file: "patches/0001-3.11.0-fix-gcc-7.0-7.3.patch" patch_description: "Fix GCC 7.0 to 7.3" patch_type: "portability" diff --git a/recipes/entt/3.x.x/patches/0002-3.12.1-fix-gcc-7.0-7.3.patch b/recipes/entt/3.x.x/patches/0002-3.12.1-fix-gcc-7.0-7.3.patch new file mode 100644 index 0000000000000..d3cb85f5fbcc6 --- /dev/null +++ b/recipes/entt/3.x.x/patches/0002-3.12.1-fix-gcc-7.0-7.3.patch @@ -0,0 +1,20 @@ +--- a/src/entt/meta/meta.hpp ++++ b/src/entt/meta/meta.hpp +@@ -1688,7 +1688,7 @@ public: + using reference = value_type; + using iterator_category = std::input_iterator_tag; + +- constexpr meta_iterator() noexcept ++ meta_iterator() noexcept + : ctx{}, + vtable{}, + handle{} {} +@@ -1782,7 +1782,7 @@ public: + using reference = value_type; + using iterator_category = std::input_iterator_tag; + +- constexpr meta_iterator() noexcept ++ meta_iterator() noexcept + : ctx{}, + vtable{}, + handle{} {} diff --git a/recipes/entt/config.yml b/recipes/entt/config.yml index 0000b93d983f2..3eaedc6257e18 100644 --- a/recipes/entt/config.yml +++ b/recipes/entt/config.yml @@ -1,39 +1,7 @@ versions: - "3.11.1": + "3.12.2": folder: 3.x.x - "3.11.0": + "3.11.1": folder: 3.x.x "3.10.3": folder: 3.x.x - "3.10.1": - folder: 3.x.x - "3.10.0": - folder: 3.x.x - "3.9.0": - folder: 3.x.x - "3.8.1": - folder: 3.x.x - "3.8.0": - folder: 3.x.x - "3.7.1": - folder: 3.x.x - "3.7.0": - folder: 3.x.x - "3.6.0": - folder: 3.x.x - "3.5.2": - folder: 3.x.x - "3.5.1": - folder: 3.x.x - "3.5.0": - folder: 3.x.x - "3.4.0": - folder: 3.x.x - "3.3.2": - folder: 3.x.x - "3.3.1": - folder: 3.x.x - "3.3.0": - folder: 3.x.x - "3.2.2": - folder: 3.x.x From c8b65a5d19545673e4d4a9efd788a0557bf5b263 Mon Sep 17 00:00:00 2001 From: Martin Delille Date: Tue, 27 Jun 2023 12:42:29 +0200 Subject: [PATCH 06/59] (#18075) [sentry-crashpad] Update to 0.6.4 * [sentry-crashpad] Update to 0.6.4 * Modify sentry-crashpad config.yml instead of sentry-breakpad config.yml --- recipes/sentry-crashpad/all/conandata.yml | 6 +++--- recipes/sentry-crashpad/config.yml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/recipes/sentry-crashpad/all/conandata.yml b/recipes/sentry-crashpad/all/conandata.yml index 059f423b2eba7..17d89711effcc 100644 --- a/recipes/sentry-crashpad/all/conandata.yml +++ b/recipes/sentry-crashpad/all/conandata.yml @@ -1,13 +1,13 @@ sources: + "0.6.4": + url: "https://github.com/getsentry/sentry-native/releases/download/0.6.4/sentry-native.zip" + sha256: "e00278bf9a4821bb4008985a5a552a84aba6ebb06d3f9e828082fcbf06b04a38" "0.6.3": url: "https://github.com/getsentry/sentry-native/releases/download/0.6.3/sentry-native.zip" sha256: "6b515c17a9b860ea47c6a5fd7abdfdc89b4b8cbc654c23a8bb42a39bfcb87ad9" "0.6.2": url: "https://github.com/getsentry/sentry-native/releases/download/0.6.2/sentry-native.zip" sha256: "9b9f4b2cec961ca132039c7887fb876b3dd6f4795b31ca01d188187f69758efa" - "0.6.1": - url: "https://github.com/getsentry/sentry-native/releases/download/0.6.1/sentry-native.zip" - sha256: "47527a3513db141affb8af28a0b8d886f78348a65acd2110d7eed936e3d82954" "0.5.4": url: "https://github.com/getsentry/sentry-native/releases/download/0.5.4/sentry-native.zip" sha256: "e151bdc76894eb964ba4637361b2a96b7447fb04212053cf695fd7f72b636e4d" diff --git a/recipes/sentry-crashpad/config.yml b/recipes/sentry-crashpad/config.yml index 205b96ca25c22..fb99bc2eb64b8 100644 --- a/recipes/sentry-crashpad/config.yml +++ b/recipes/sentry-crashpad/config.yml @@ -1,10 +1,10 @@ versions: + "0.6.4": + folder: all "0.6.3": folder: all "0.6.2": folder: all - "0.6.1": - folder: all "0.5.4": folder: all "0.4.18": From 0fabf127f10b29ce923766f29f48b488c1db2ec6 Mon Sep 17 00:00:00 2001 From: Joakim Haugen Date: Tue, 27 Jun 2023 13:02:52 +0200 Subject: [PATCH 07/59] (#17573) metis: add support for conan v2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add support for conan v2 * Fix typo referencing new option * Change from build_requires to tool_requires * Update recipe after review suggestions * Pick some memory bugfix patches - This ensures successful 32bit test_package builds --------- Co-authored-by: Francisco Ramírez --- recipes/metis/all/CMakeLists.txt | 10 - recipes/metis/all/conandata.yml | 26 +- recipes/metis/all/conanfile.py | 88 +-- .../all/patches/004-use-conan-gklib.patch | 2 +- .../006-require-newer-cmakelists.patch | 22 + ...-fix-memory-bug-same-size-coarsening.patch | 721 ++++++++++++++++++ .../008-fix-memory-bug-coarsening.patch | 470 ++++++++++++ recipes/metis/all/test_package/CMakeLists.txt | 3 - recipes/metis/all/test_package/conanfile.py | 27 +- .../metis/all/test_v1_package/CMakeLists.txt | 8 + .../metis/all/test_v1_package/conanfile.py | 18 + 11 files changed, 1316 insertions(+), 79 deletions(-) delete mode 100644 recipes/metis/all/CMakeLists.txt create mode 100644 recipes/metis/all/patches/006-require-newer-cmakelists.patch create mode 100644 recipes/metis/all/patches/007-fix-memory-bug-same-size-coarsening.patch create mode 100644 recipes/metis/all/patches/008-fix-memory-bug-coarsening.patch create mode 100644 recipes/metis/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/metis/all/test_v1_package/conanfile.py diff --git a/recipes/metis/all/CMakeLists.txt b/recipes/metis/all/CMakeLists.txt deleted file mode 100644 index 15cbde395086d..0000000000000 --- a/recipes/metis/all/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -cmake_minimum_required(VERSION 3.4) -project(cmake_wrapper LANGUAGES C) - -include(conanbuildinfo.cmake) -conan_basic_setup(KEEP_RPATHS) - -set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) -set(GKLIB_PATH "${CMAKE_CURRENT_LIST_DIR}/source_subfolder/GKlib" CACHE PATH "") - -add_subdirectory(source_subfolder) diff --git a/recipes/metis/all/conandata.yml b/recipes/metis/all/conandata.yml index 396a06387b94f..b58bdca27dce2 100644 --- a/recipes/metis/all/conandata.yml +++ b/recipes/metis/all/conandata.yml @@ -5,12 +5,28 @@ sources: patches: "5.1.1": - patch_file: "patches/001-add-gklib-system-cmake.patch" - base_path: "source_subfolder" + patch_type: "conan" + patch_description: "Add gklib system cmake" - patch_file: "patches/002-support-pure-cmake.patch" - base_path: "source_subfolder" + patch_type: "conan" + patch_description: "Support pure CMake" - patch_file: "patches/003-remove-programs.patch" - base_path: "source_subfolder" + patch_type: "conan" + patch_description: "Remove building of programs" - patch_file: "patches/004-use-conan-gklib.patch" - base_path: "source_subfolder" + patch_type: "conan" + patch_description: "Use conan gklib" - patch_file: "patches/005-fix-install.patch" - base_path: "source_subfolder" + patch_type: "conan" + patch_description: "Fix runtime install" + - patch_file: "patches/006-require-newer-cmakelists.patch" + patch_type: "conan" + patch_description: "Require newer CMakeLists" + - patch_file: "patches/007-fix-memory-bug-same-size-coarsening.patch" + patch_type: "bugfix" + patch_source: "https://github.com/KarypisLab/METIS/commit/36262adecaa9720a4417a67124428061c367fd3f" + patch_description: "Fix memory bug when coarser graph stays the same" + - patch_file: "patches/008-fix-memory-bug-coarsening.patch" + patch_type: "bugfix" + patch_source: "https://github.com/KarypisLab/METIS/commit/38a8fb0fd1cdde963b04997c7be844028602793a" + patch_description: "Fix memory bug when coarsening" diff --git a/recipes/metis/all/conanfile.py b/recipes/metis/all/conanfile.py index 7e077e7ea6112..3877d7ef5d8e7 100644 --- a/recipes/metis/all/conanfile.py +++ b/recipes/metis/all/conanfile.py @@ -1,9 +1,11 @@ -from conans import ConanFile, CMake, tools -from conan.tools.files import apply_conandata_patches -import os +from os import path +from conan import ConanFile +from conan.tools.microsoft import is_msvc +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy +from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.53.0" class METISConan(ConanFile): name = "metis" @@ -14,38 +16,25 @@ class METISConan(ConanFile): " partitioning finite element meshes, and producing" \ " fill reducing orderings for sparse matrices" topics = ("karypislab", "graph", "partitioning-algorithms") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], + "with_64bit_types": [True, False], } default_options = { "shared": False, "fPIC": True, + "with_64bit_types": True, } - generators = "cmake", "cmake_find_package" - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _build_subfolder(self): - return "build_subfolder" - - @property - def _is_msvc(self): - return str(self.settings.compiler) in ["Visual Studio", "msvc"] @property def _is_mingw(self): return self.settings.os == "Windows" and self.settings.compiler == "gcc" 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": @@ -53,49 +42,52 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd + 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): self.requires("gklib/5.1.1") def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) - - def _patch_sources(self): - apply_conandata_patches(self) - - def _configure_cmake(self): - if not self._cmake: - self._cmake = CMake(self) - self._cmake.definitions["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" - self._cmake.definitions["SHARED"] = self.options.shared - self._cmake.definitions["METIS_INSTALL"] = True - self._cmake.definitions["ASSERT"] = self.settings.build_type == "Debug" - self._cmake.definitions["ASSERT2"] = self.settings.build_type == "Debug" - self._cmake.definitions["METIS_IDX64"] = True - self._cmake.definitions["METIS_REAL64"] = True - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + tc.variables["SHARED"] = self.options.shared + tc.variables["METIS_INSTALL"] = True + tc.variables["ASSERT"] = self.settings.build_type == "Debug" + tc.variables["ASSERT2"] = self.settings.build_type == "Debug" + tc.variables["METIS_IDX64"] = self.options.with_64bit_types + tc.variables["METIS_REAL64"] = self.options.with_64bit_types + 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): - cmake = self._configure_cmake() + copy(self, pattern="LICENSE", src=self.source_folder, dst=path.join(self.package_folder, "licenses")) + cmake = CMake(self) cmake.install() - self.copy("LICENSE", src=self._source_subfolder, dst="licenses") def package_info(self): self.cpp_info.libs = ["metis"] self.cpp_info.requires.append("gklib::gklib") + if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs.append("m") - if self._is_msvc or self._is_mingw: + if is_msvc(self) or self._is_mingw: self.cpp_info.defines.append("USE_GKREGEX") - if self._is_msvc: + if is_msvc(self): self.cpp_info.defines.append("__thread=__declspec(thread)") diff --git a/recipes/metis/all/patches/004-use-conan-gklib.patch b/recipes/metis/all/patches/004-use-conan-gklib.patch index 60a824f3c58d1..e4a4869c0f7e8 100644 --- a/recipes/metis/all/patches/004-use-conan-gklib.patch +++ b/recipes/metis/all/patches/004-use-conan-gklib.patch @@ -7,7 +7,7 @@ find gklib from conan # Build libmetis. -add_library(metis ${METIS_LIBRARY_TYPE} ${GKlib_sources} ${metis_sources}) +add_library(metis ${METIS_LIBRARY_TYPE} ${metis_sources}) -+find_package(gklib REQUIRED) ++find_package(gklib CONFIG REQUIRED) +target_link_libraries(metis PRIVATE gklib::gklib) if(UNIX) - target_link_libraries(metis m) diff --git a/recipes/metis/all/patches/006-require-newer-cmakelists.patch b/recipes/metis/all/patches/006-require-newer-cmakelists.patch new file mode 100644 index 0000000000000..30d57e079922a --- /dev/null +++ b/recipes/metis/all/patches/006-require-newer-cmakelists.patch @@ -0,0 +1,22 @@ +From d9370febe8aa0e533d15604532f75fc355731283 Mon Sep 17 00:00:00 2001 +From: Joakim Haugen +Date: Mon, 15 May 2023 13:24:33 +0200 +Subject: [PATCH] Require newer CMakeLists + +--- + CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 9630af8..39e33fe 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,4 +1,4 @@ +-cmake_minimum_required(VERSION 2.8) ++cmake_minimum_required(VERSION 3.4) + project(METIS C) + + set(GKLIB_PATH "${CMAKE_SOURCE_DIR}/GKlib" CACHE PATH "path to GKlib") +-- +2.30.2 + diff --git a/recipes/metis/all/patches/007-fix-memory-bug-same-size-coarsening.patch b/recipes/metis/all/patches/007-fix-memory-bug-same-size-coarsening.patch new file mode 100644 index 0000000000000..443f47179f6da --- /dev/null +++ b/recipes/metis/all/patches/007-fix-memory-bug-same-size-coarsening.patch @@ -0,0 +1,721 @@ +From 36262adecaa9720a4417a67124428061c367fd3f Mon Sep 17 00:00:00 2001 +From: George Karypis +Date: Fri, 27 Nov 2020 23:17:52 +0000 +Subject: [PATCH] fixed a memory bug that appears when the coarser graph stayed + the same size as the original graph + +--- + libmetis/coarsen.c | 551 ++------------------------------------------- + libmetis/kmetis.c | 5 +- + libmetis/pmetis.c | 4 + + 3 files changed, 30 insertions(+), 530 deletions(-) + +diff --git a/libmetis/coarsen.c b/libmetis/coarsen.c +index 447fc43..a804dc8 100644 +--- a/libmetis/coarsen.c ++++ b/libmetis/coarsen.c +@@ -818,516 +818,6 @@ void PrintCGraphStats(ctrl_t *ctrl, graph_t *graph) + } + + +-/*************************************************************************/ +-/*! This function creates the coarser graph. It uses a simple hash-table +- for identifying the adjacent vertices that get collapsed to the same +- node. The hash-table can have conflicts, which are handled via a +- linear scan. +- */ +-/*************************************************************************/ +-void CreateCoarseGraph0(ctrl_t *ctrl, graph_t *graph, idx_t cnvtxs, +- idx_t *match) +-{ +- idx_t j, jj, k, kk, l, m, istart, iend, nvtxs, nedges, ncon, cnedges, v, u; +- idx_t *xadj, *vwgt, *vsize, *adjncy, *adjwgt; +- idx_t *cmap, *htable; +- idx_t *cxadj, *cvwgt, *cvsize, *cadjncy, *cadjwgt; +- graph_t *cgraph; +- int mask, dovsize, dropedges; +- idx_t cv, nkeep, droppedewgt; +- idx_t *keys=NULL, *medianewgts=NULL, *noise=NULL; +- +- dovsize = (ctrl->objtype == METIS_OBJTYPE_VOL ? 1 : 0); +- dropedges = ctrl->dropedges; +- +- /* Check if the mask-version of the code is a good choice */ +- mask = HTLENGTH; +- if (cnvtxs < 2*mask || graph->nedges/graph->nvtxs > mask/20) { +- CreateCoarseGraphNoMask(ctrl, graph, cnvtxs, match); +- return; +- } +- +- nvtxs = graph->nvtxs; +- xadj = graph->xadj; +- for (v=0; v (mask>>3)) { +- CreateCoarseGraphNoMask(ctrl, graph, cnvtxs, match); +- return; +- } +- } +- +- +- WCOREPUSH; +- +- IFSET(ctrl->dbglvl, METIS_DBG_TIME, gk_startcputimer(ctrl->ContractTmr)); +- +- ncon = graph->ncon; +- vwgt = graph->vwgt; +- vsize = graph->vsize; +- adjncy = graph->adjncy; +- adjwgt = graph->adjwgt; +- cmap = graph->cmap; +- +- /* Setup structures for dropedges */ +- if (dropedges) { +- for (nkeep=-1, v=0; vxadj; +- cvwgt = cgraph->vwgt; +- cvsize = cgraph->vsize; +- cadjncy = cgraph->adjncy; +- cadjwgt = cgraph->adjwgt; +- +- htable = iset(gk_min(cnvtxs+1, mask+1), -1, iwspacemalloc(ctrl, mask+1)); +- +- cxadj[0] = cnvtxs = cnedges = 0; +- for (v=0; v= 0 && cadjncy[jj] != cnvtxs) { +- for (jj=0; jj= 0 && jj < nedges && cadjncy[jj] == cnvtxs) { +- cadjncy[jj] = cadjncy[--nedges]; +- cadjwgt[jj] = cadjwgt[nedges]; +- } +- } +- +- /* Zero out the htable */ +- for (j=0; j= min(medianewgts[u], medianewgts[v]) */ +- if (dropedges) { +- for (j=0; j>1)]; +- } +- +- cadjncy += nedges; +- cadjwgt += nedges; +- cnedges += nedges; +- cxadj[++cnvtxs] = cnedges; +- } +- +- /* compact the adjacency structure of the coarser graph to keep only +ve edges */ +- if (dropedges) { +- droppedewgt = 0; +- +- cadjncy = cgraph->adjncy; +- cadjwgt = cgraph->adjwgt; +- +- cnedges = 0; +- for (u=0; u= gk_min(medianewgts[u], medianewgts[v])) { +- cadjncy[cnedges] = cadjncy[j]; +- cadjwgt[cnedges++] = cadjwgt[j]; +- } +- else +- droppedewgt += cadjwgt[j]; +- } +- cxadj[u] = cnedges; +- } +- SHIFTCSR(j, cnvtxs, cxadj); +- +- //printf("droppedewgt: %d\n", (int)droppedewgt); +- +- cgraph->droppedewgt = droppedewgt; +- } +- +- cgraph->nedges = cnedges; +- +- for (j=0; jtvwgt[j] = isum(cgraph->nvtxs, cgraph->vwgt+j, ncon); +- cgraph->invtvwgt[j] = 1.0/(cgraph->tvwgt[j] > 0 ? cgraph->tvwgt[j] : 1); +- } +- +- +- ReAdjustMemory(ctrl, graph, cgraph); +- +- IFSET(ctrl->dbglvl, METIS_DBG_TIME, gk_stopcputimer(ctrl->ContractTmr)); +- +- WCOREPOP; +-} +- +- +-/*************************************************************************/ +-/*! This function creates the coarser graph. It uses a simple hash-table +- for identifying the adjacent vertices that get collapsed to the same +- node. The hash-table can have conflicts, which are handled via a +- linear scan. +- */ +-/*************************************************************************/ +-void CreateCoarseGraph1(ctrl_t *ctrl, graph_t *graph, idx_t cnvtxs, +- idx_t *match) +-{ +- idx_t j, jj, k, kk, l, m, istart, iend, nvtxs, nedges, ncon, +- cnedges, v, u, mask; +- idx_t *xadj, *vwgt, *vsize, *adjncy, *adjwgt; +- idx_t *cmap, *htable, *table; +- idx_t *cxadj, *cvwgt, *cvsize, *cadjncy, *cadjwgt; +- graph_t *cgraph; +- int dovsize, dropedges, usemask; +- idx_t cv, nkeep, droppedewgt; +- idx_t *keys=NULL, *medianewgts=NULL, *noise=NULL; +- +- WCOREPUSH; +- +- dovsize = (ctrl->objtype == METIS_OBJTYPE_VOL ? 1 : 0); +- dropedges = ctrl->dropedges; +- +- mask = HTLENGTH; +- +- IFSET(ctrl->dbglvl, METIS_DBG_TIME, gk_startcputimer(ctrl->ContractTmr)); +- +- nvtxs = graph->nvtxs; +- ncon = graph->ncon; +- xadj = graph->xadj; +- vwgt = graph->vwgt; +- vsize = graph->vsize; +- adjncy = graph->adjncy; +- adjwgt = graph->adjwgt; +- cmap = graph->cmap; +- +- /* Setup structures for dropedges */ +- if (dropedges) { +- for (nkeep=-1, v=0; vxadj; +- cvwgt = cgraph->vwgt; +- cvsize = cgraph->vsize; +- cadjncy = cgraph->adjncy; +- cadjwgt = cgraph->adjwgt; +- +- htable = iset(gk_min(cnvtxs+1, mask+1), -1, iwspacemalloc(ctrl, mask+1)); +- table = iset(cnvtxs, -1, iwspacemalloc(ctrl, cnvtxs)); +- +- cxadj[0] = cnvtxs = cnedges = 0; +- for (v=0; v (mask>>3) ? 0 : 1); +- nedges = 0; +- +- +- if (usemask) { +- istart = xadj[v]; +- iend = xadj[v+1]; +- for (j=istart; j= 0 && cadjncy[jj] != cnvtxs) { +- for (jj=0; jj= 0 && jj < nedges && cadjncy[jj] == cnvtxs) { +- cadjncy[jj] = cadjncy[--nedges]; +- cadjwgt[jj] = cadjwgt[nedges]; +- } +- } +- +- /* Zero out the htable */ +- for (j=0; j= min(medianewgts[u], medianewgts[v]) */ +- if (dropedges) { +- for (j=0; j>1)]; +- } +- +- cadjncy += nedges; +- cadjwgt += nedges; +- cnedges += nedges; +- cxadj[++cnvtxs] = cnedges; +- } +- +- /* compact the adjacency structure of the coarser graph to keep only +ve edges */ +- if (dropedges) { +- droppedewgt = 0; +- +- cadjncy = cgraph->adjncy; +- cadjwgt = cgraph->adjwgt; +- +- cnedges = 0; +- for (u=0; u= gk_min(medianewgts[u], medianewgts[v])) { +- cadjncy[cnedges] = cadjncy[j]; +- cadjwgt[cnedges++] = cadjwgt[j]; +- } +- else +- droppedewgt += cadjwgt[j]; +- } +- cxadj[u] = cnedges; +- } +- SHIFTCSR(j, cnvtxs, cxadj); +- +- //printf("droppedewgt: %d\n", (int)droppedewgt); +- +- cgraph->droppedewgt = droppedewgt; +- } +- +- cgraph->nedges = cnedges; +- +- for (j=0; jtvwgt[j] = isum(cgraph->nvtxs, cgraph->vwgt+j, ncon); +- cgraph->invtvwgt[j] = 1.0/(cgraph->tvwgt[j] > 0 ? cgraph->tvwgt[j] : 1); +- } +- +- +- ReAdjustMemory(ctrl, graph, cgraph); +- +- IFSET(ctrl->dbglvl, METIS_DBG_TIME, gk_stopcputimer(ctrl->ContractTmr)); +- +- WCOREPOP; +-} +- +- + /*************************************************************************/ + /*! This function creates the coarser graph. Depending on the size of the + candidate adjancency lists it either uses a hash table or an array +@@ -1340,7 +830,7 @@ void CreateCoarseGraph(ctrl_t *ctrl, graph_t *graph, idx_t cnvtxs, + idx_t j, jj, k, kk, l, m, istart, iend, nvtxs, nedges, ncon, + cnedges, v, u, mask; + idx_t *xadj, *vwgt, *vsize, *adjncy, *adjwgt; +- idx_t *cmap, *htable, *table; ++ idx_t *cmap, *htable, *dtable; + idx_t *cxadj, *cvwgt, *cvsize, *cadjncy, *cadjwgt; + graph_t *cgraph; + int dovsize, dropedges; +@@ -1386,8 +876,8 @@ void CreateCoarseGraph(ctrl_t *ctrl, graph_t *graph, idx_t cnvtxs, + cadjncy = cgraph->adjncy; + cadjwgt = cgraph->adjwgt; + +- htable = iset(gk_min(cnvtxs+1, mask+1), -1, iwspacemalloc(ctrl, mask+1)); +- table = iset(cnvtxs, -1, iwspacemalloc(ctrl, cnvtxs)); ++ htable = iset(mask+1, -1, iwspacemalloc(ctrl, mask+1)); /* hash table */ ++ dtable = iset(cnvtxs, -1, iwspacemalloc(ctrl, cnvtxs)); /* direct table */ + + cxadj[0] = cnvtxs = cnedges = 0; + for (v=0; vinvtvwgt[j] = 1.0/(cgraph->tvwgt[j] > 0 ? cgraph->tvwgt[j] : 1); + } + +- + ReAdjustMemory(ctrl, graph, cgraph); + + IFSET(ctrl->dbglvl, METIS_DBG_TIME, gk_stopcputimer(ctrl->ContractTmr)); +@@ -1942,10 +1431,14 @@ graph_t *SetupCoarseGraph(graph_t *graph, idx_t cnvtxs, int dovsize) + cgraph->finer = graph; + graph->coarser = cgraph; + +- /* Allocate memory for the coarser graph */ ++ /* Allocate memory for the coarser graph. ++ NOTE: The +1 in the adjwgt/adjncy is to allow the optimization of self-loop ++ detection by adding ahead of time the self-loop. That optimization ++ requires a +1 adjncy/adjwgt array for the limit case where the ++ coarser graph is of the same size of the previous graph. */ + cgraph->xadj = imalloc(cnvtxs+1, "SetupCoarseGraph: xadj"); +- cgraph->adjncy = imalloc(graph->nedges, "SetupCoarseGraph: adjncy"); +- cgraph->adjwgt = imalloc(graph->nedges, "SetupCoarseGraph: adjwgt"); ++ cgraph->adjncy = imalloc(graph->nedges+1, "SetupCoarseGraph: adjncy"); ++ cgraph->adjwgt = imalloc(graph->nedges+1, "SetupCoarseGraph: adjwgt"); + cgraph->vwgt = imalloc(cgraph->ncon*cnvtxs, "SetupCoarseGraph: vwgt"); + cgraph->tvwgt = imalloc(cgraph->ncon, "SetupCoarseGraph: tvwgt"); + cgraph->invtvwgt = rmalloc(cgraph->ncon, "SetupCoarseGraph: invtvwgt"); +diff --git a/libmetis/kmetis.c b/libmetis/kmetis.c +index c56c513..8491006 100644 +--- a/libmetis/kmetis.c ++++ b/libmetis/kmetis.c +@@ -24,6 +24,7 @@ int METIS_PartGraphKway(idx_t *nvtxs, idx_t *ncon, idx_t *xadj, idx_t *adjncy, + graph_t *graph; + ctrl_t *ctrl; + ++#ifdef XXX + /* set up malloc cleaning code and signal catchers */ + if (!gk_malloc_init()) + return METIS_ERROR_MEMORY; +@@ -32,7 +33,7 @@ int METIS_PartGraphKway(idx_t *nvtxs, idx_t *ncon, idx_t *xadj, idx_t *adjncy, + + if ((sigrval = gk_sigcatch()) != 0) + goto SIGTHROW; +- ++#endif + + /* set up the run parameters */ + ctrl = SetupCtrl(METIS_OP_KMETIS, options, *ncon, *nparts, tpwgts, ubvec); +@@ -86,8 +87,10 @@ SIGTHROW: + if (renumber) + Change2FNumbering(*nvtxs, xadj, adjncy, part); + ++#ifdef XXX + gk_siguntrap(); + gk_malloc_cleanup(0); ++#endif + + return metis_rcode(sigrval); + } +diff --git a/libmetis/pmetis.c b/libmetis/pmetis.c +index d32e849..80e2149 100644 +--- a/libmetis/pmetis.c ++++ b/libmetis/pmetis.c +@@ -97,6 +97,7 @@ int METIS_PartGraphRecursive(idx_t *nvtxs, idx_t *ncon, idx_t *xadj, + graph_t *graph; + ctrl_t *ctrl; + ++#ifdef XXX + /* set up malloc cleaning code and signal catchers */ + if (!gk_malloc_init()) + return METIS_ERROR_MEMORY; +@@ -105,6 +106,7 @@ int METIS_PartGraphRecursive(idx_t *nvtxs, idx_t *ncon, idx_t *xadj, + + if ((sigrval = gk_sigcatch()) != 0) + goto SIGTHROW; ++#endif + + + /* set up the run parameters */ +@@ -143,8 +145,10 @@ SIGTHROW: + if (renumber) + Change2FNumbering(*nvtxs, xadj, adjncy, part); + ++#ifdef XXX + gk_siguntrap(); + gk_malloc_cleanup(0); ++#endif + + return metis_rcode(sigrval); + } +-- +2.30.2 + diff --git a/recipes/metis/all/patches/008-fix-memory-bug-coarsening.patch b/recipes/metis/all/patches/008-fix-memory-bug-coarsening.patch new file mode 100644 index 0000000000000..d24815a50e241 --- /dev/null +++ b/recipes/metis/all/patches/008-fix-memory-bug-coarsening.patch @@ -0,0 +1,470 @@ +From 38a8fb0fd1cdde963b04997c7be844028602793a Mon Sep 17 00:00:00 2001 +From: George Karypis +Date: Fri, 27 Nov 2020 23:23:07 +0000 +Subject: [PATCH] Fixed a memory bug in coarsening + +--- + libmetis/coarsen.c | 352 --------------------------------------------- + libmetis/kmetis.c | 4 - + libmetis/pmetis.c | 5 - + libmetis/proto.h | 4 - + libmetis/rename.h | 2 - + 5 files changed, 367 deletions(-) + +diff --git a/libmetis/coarsen.c b/libmetis/coarsen.c +index a804dc8..81876de 100644 +--- a/libmetis/coarsen.c ++++ b/libmetis/coarsen.c +@@ -1063,358 +1063,6 @@ void CreateCoarseGraph(ctrl_t *ctrl, graph_t *graph, idx_t cnvtxs, + } + + +-/*************************************************************************/ +-/*! This function creates the coarser graph. It uses a full-size array +- (htable) for identifying the adjacent vertices that get collapsed to +- the same node. +- */ +-/*************************************************************************/ +-void CreateCoarseGraphNoMask(ctrl_t *ctrl, graph_t *graph, idx_t cnvtxs, +- idx_t *match) +-{ +- idx_t j, k, m, istart, iend, v, u, nvtxs, nedges, ncon, cnedges; +- idx_t *xadj, *vwgt, *vsize, *adjncy, *adjwgt; +- idx_t *cmap, *htable; +- idx_t *cxadj, *cvwgt, *cvsize, *cadjncy, *cadjwgt; +- graph_t *cgraph; +- int dovsize, dropedges; +- idx_t cv, nkeep, droppedewgt; +- idx_t *keys=NULL, *medianewgts=NULL, *noise=NULL; +- +- WCOREPUSH; +- +- dovsize = (ctrl->objtype == METIS_OBJTYPE_VOL ? 1 : 0); +- dropedges = ctrl->dropedges; +- +- IFSET(ctrl->dbglvl, METIS_DBG_TIME, gk_startcputimer(ctrl->ContractTmr)); +- +- nvtxs = graph->nvtxs; +- ncon = graph->ncon; +- xadj = graph->xadj; +- vwgt = graph->vwgt; +- vsize = graph->vsize; +- adjncy = graph->adjncy; +- adjwgt = graph->adjwgt; +- cmap = graph->cmap; +- +- /* Setup structures for dropedges */ +- if (dropedges) { +- for (nkeep=-1, v=0; vxadj; +- cvwgt = cgraph->vwgt; +- cvsize = cgraph->vsize; +- cadjncy = cgraph->adjncy; +- cadjwgt = cgraph->adjwgt; +- +- htable = iset(cnvtxs, -1, iwspacemalloc(ctrl, cnvtxs)); +- +- cxadj[0] = cnvtxs = cnedges = 0; +- for (v=0; v= min(medianewgts[u], medianewgts[v]) */ +- if (dropedges) { +- for (j=0; j>1)]; +- } +- +- /* Record Advance the cadjXXX pointers */ +- cadjncy += nedges; +- cadjwgt += nedges; +- cnedges += nedges; +- cxadj[++cnvtxs] = cnedges; +- } +- +- +- /* compact the adjacency structure of the coarser graph to keep only +ve edges */ +- if (dropedges) { +- droppedewgt = 0; +- +- cadjncy = cgraph->adjncy; +- cadjwgt = cgraph->adjwgt; +- +- cnedges = 0; +- for (u=0; u= gk_min(medianewgts[u], medianewgts[v])) { +- cadjncy[cnedges] = cadjncy[j]; +- cadjwgt[cnedges++] = cadjwgt[j]; +- } +- else +- droppedewgt += cadjwgt[j]; +- } +- cxadj[u] = cnedges; +- } +- SHIFTCSR(j, cnvtxs, cxadj); +- +- //printf("droppedewgt: %d\n", (int)droppedewgt); +- +- cgraph->droppedewgt = droppedewgt; +- } +- +- cgraph->nedges = cnedges; +- +- for (j=0; jtvwgt[j] = isum(cgraph->nvtxs, cgraph->vwgt+j, ncon); +- cgraph->invtvwgt[j] = 1.0/(cgraph->tvwgt[j] > 0 ? cgraph->tvwgt[j] : 1); +- } +- +- ReAdjustMemory(ctrl, graph, cgraph); +- +- IFSET(ctrl->dbglvl, METIS_DBG_TIME, gk_stopcputimer(ctrl->ContractTmr)); +- +- WCOREPOP; +-} +- +- +-/*************************************************************************/ +-/*! This function creates the coarser graph. It uses a simple hash-table +- for identifying the adjacent vertices that get collapsed to the same +- node. The hash-table can have conflicts, which are handled via a +- linear scan. It relies on the perm[] array to visit the vertices in +- increasing cnvtxs order. +- */ +-/*************************************************************************/ +-void CreateCoarseGraphPerm(ctrl_t *ctrl, graph_t *graph, idx_t cnvtxs, +- idx_t *match, idx_t *perm) +-{ +- idx_t i, j, jj, k, kk, l, m, istart, iend, nvtxs, nedges, ncon, cnedges, +- v, u, mask, dovsize; +- idx_t *xadj, *vwgt, *vsize, *adjncy, *adjwgt; +- idx_t *cmap, *htable; +- idx_t *cxadj, *cvwgt, *cvsize, *cadjncy, *cadjwgt; +- graph_t *cgraph; +- +- WCOREPUSH; +- +- IFSET(ctrl->dbglvl, METIS_DBG_TIME, gk_startcputimer(ctrl->ContractTmr)); +- +- dovsize = (ctrl->objtype == METIS_OBJTYPE_VOL ? 1 : 0); +- +- mask = HTLENGTH; +- +- nvtxs = graph->nvtxs; +- ncon = graph->ncon; +- xadj = graph->xadj; +- vwgt = graph->vwgt; +- vsize = graph->vsize; +- adjncy = graph->adjncy; +- adjwgt = graph->adjwgt; +- cmap = graph->cmap; +- +- /* Initialize the coarser graph */ +- cgraph = SetupCoarseGraph(graph, cnvtxs, dovsize); +- cxadj = cgraph->xadj; +- cvwgt = cgraph->vwgt; +- cvsize = cgraph->vsize; +- cadjncy = cgraph->adjncy; +- cadjwgt = cgraph->adjwgt; +- +- htable = iset(mask+1, -1, iwspacemalloc(ctrl, mask+1)); +- +- cxadj[0] = cnvtxs = cnedges = 0; +- for (i=0; i= 0 && cadjncy[jj] != cnvtxs) { +- for (jj=0; jj= 0 && cadjncy[jj] == cnvtxs) { /* This 2nd check is needed for non-adjacent matchings */ +- cadjncy[jj] = cadjncy[--nedges]; +- cadjwgt[jj] = cadjwgt[nedges]; +- } +- } +- +- for (j=0; jnedges = cnedges; +- +- for (i=0; itvwgt[i] = isum(cgraph->nvtxs, cgraph->vwgt+i, ncon); +- cgraph->invtvwgt[i] = 1.0/(cgraph->tvwgt[i] > 0 ? cgraph->tvwgt[i] : 1); +- } +- +- +- ReAdjustMemory(ctrl, graph, cgraph); +- +- IFSET(ctrl->dbglvl, METIS_DBG_TIME, gk_stopcputimer(ctrl->ContractTmr)); +- +- WCOREPOP; +-} +- +- + /*************************************************************************/ + /*! Setup the various arrays for the coarse graph + */ +diff --git a/libmetis/kmetis.c b/libmetis/kmetis.c +index 8491006..94c6c02 100644 +--- a/libmetis/kmetis.c ++++ b/libmetis/kmetis.c +@@ -24,7 +24,6 @@ int METIS_PartGraphKway(idx_t *nvtxs, idx_t *ncon, idx_t *xadj, idx_t *adjncy, + graph_t *graph; + ctrl_t *ctrl; + +-#ifdef XXX + /* set up malloc cleaning code and signal catchers */ + if (!gk_malloc_init()) + return METIS_ERROR_MEMORY; +@@ -33,7 +32,6 @@ int METIS_PartGraphKway(idx_t *nvtxs, idx_t *ncon, idx_t *xadj, idx_t *adjncy, + + if ((sigrval = gk_sigcatch()) != 0) + goto SIGTHROW; +-#endif + + /* set up the run parameters */ + ctrl = SetupCtrl(METIS_OP_KMETIS, options, *ncon, *nparts, tpwgts, ubvec); +@@ -87,10 +85,8 @@ SIGTHROW: + if (renumber) + Change2FNumbering(*nvtxs, xadj, adjncy, part); + +-#ifdef XXX + gk_siguntrap(); + gk_malloc_cleanup(0); +-#endif + + return metis_rcode(sigrval); + } +diff --git a/libmetis/pmetis.c b/libmetis/pmetis.c +index 80e2149..004e1bb 100644 +--- a/libmetis/pmetis.c ++++ b/libmetis/pmetis.c +@@ -97,7 +97,6 @@ int METIS_PartGraphRecursive(idx_t *nvtxs, idx_t *ncon, idx_t *xadj, + graph_t *graph; + ctrl_t *ctrl; + +-#ifdef XXX + /* set up malloc cleaning code and signal catchers */ + if (!gk_malloc_init()) + return METIS_ERROR_MEMORY; +@@ -106,8 +105,6 @@ int METIS_PartGraphRecursive(idx_t *nvtxs, idx_t *ncon, idx_t *xadj, + + if ((sigrval = gk_sigcatch()) != 0) + goto SIGTHROW; +-#endif +- + + /* set up the run parameters */ + ctrl = SetupCtrl(METIS_OP_PMETIS, options, *ncon, *nparts, tpwgts, ubvec); +@@ -145,10 +142,8 @@ SIGTHROW: + if (renumber) + Change2FNumbering(*nvtxs, xadj, adjncy, part); + +-#ifdef XXX + gk_siguntrap(); + gk_malloc_cleanup(0); +-#endif + + return metis_rcode(sigrval); + } +diff --git a/libmetis/proto.h b/libmetis/proto.h +index 3a8bd80..0526be8 100644 +--- a/libmetis/proto.h ++++ b/libmetis/proto.h +@@ -51,10 +51,6 @@ idx_t Match_JC(ctrl_t *ctrl, graph_t *graph); + void PrintCGraphStats(ctrl_t *ctrl, graph_t *graph); + void CreateCoarseGraph(ctrl_t *ctrl, graph_t *graph, idx_t cnvtxs, + idx_t *match); +-void CreateCoarseGraphNoMask(ctrl_t *ctrl, graph_t *graph, idx_t cnvtxs, +- idx_t *match); +-void CreateCoarseGraphPerm(ctrl_t *ctrl, graph_t *graph, idx_t cnvtxs, +- idx_t *match, idx_t *perm); + graph_t *SetupCoarseGraph(graph_t *graph, idx_t cnvtxs, int dovsize); + void ReAdjustMemory(ctrl_t *ctrl, graph_t *graph, graph_t *cgraph); + +diff --git a/libmetis/rename.h b/libmetis/rename.h +index 59a5e76..381d5c1 100644 +--- a/libmetis/rename.h ++++ b/libmetis/rename.h +@@ -41,8 +41,6 @@ + #define Match_JC libmetis__Match_JC + #define PrintCGraphStats libmetis__PrintCGraphStats + #define CreateCoarseGraph libmetis__CreateCoarseGraph +-#define CreateCoarseGraphNoMask libmetis__CreateCoarseGraphNoMask +-#define CreateCoarseGraphPerm libmetis__CreateCoarseGraphPerm + #define SetupCoarseGraph libmetis__SetupCoarseGraph + #define ReAdjustMemory libmetis__ReAdjustMemory + +-- +2.30.2 + diff --git a/recipes/metis/all/test_package/CMakeLists.txt b/recipes/metis/all/test_package/CMakeLists.txt index 04b6e4c9401dc..54194f54c0961 100644 --- a/recipes/metis/all/test_package/CMakeLists.txt +++ b/recipes/metis/all/test_package/CMakeLists.txt @@ -1,9 +1,6 @@ cmake_minimum_required(VERSION 3.15) project(test_package CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - find_package(metis REQUIRED CONFIG) add_executable(${PROJECT_NAME} test.cpp) diff --git a/recipes/metis/all/test_package/conanfile.py b/recipes/metis/all/test_package/conanfile.py index 46d71712aba54..02eb5ce439fb4 100644 --- a/recipes/metis/all/test_package/conanfile.py +++ b/recipes/metis/all/test_package/conanfile.py @@ -1,17 +1,20 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os +# It will become the standard on Conan 2.x class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package_multi" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" - 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") + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -19,6 +22,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/metis/all/test_v1_package/CMakeLists.txt b/recipes/metis/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..5301c806a1b60 --- /dev/null +++ b/recipes/metis/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/metis/all/test_v1_package/conanfile.py b/recipes/metis/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/metis/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 225de15f8de73c25c164205383c4e5b59f93929f Mon Sep 17 00:00:00 2001 From: Conan Center Index Bot <54393557+conan-center-bot@users.noreply.github.com> Date: Tue, 27 Jun 2023 13:21:45 +0200 Subject: [PATCH 08/59] (#18071) [bot] Update list of references (prod-v2/ListPackages) --- .c3i/conan_v2_ready_references.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.c3i/conan_v2_ready_references.yml b/.c3i/conan_v2_ready_references.yml index fe95f07324499..f8f7e6a8086d5 100644 --- a/.c3i/conan_v2_ready_references.yml +++ b/.c3i/conan_v2_ready_references.yml @@ -118,6 +118,7 @@ required_for_references: - cgal - cgif - cgns +- chaiscript - charls - chef-fun - chipmunk2d @@ -401,6 +402,7 @@ required_for_references: - libnabo - libnfs - libnghttp2 +- libnl - libnop - libnova - libnuma @@ -474,6 +476,10 @@ required_for_references: - matchit - mawk - mbedtls +- mbits-args +- mbits-mstch +- mbits-semver +- mbits-utfconv - md4c - md4qt - mdnsresponder @@ -600,6 +606,7 @@ required_for_references: - restbed - restinio - ring-span-lite +- rmm - roaring - robin-hood-hashing - rttr @@ -638,8 +645,10 @@ required_for_references: - sqlite3 - sqlite_orm - sqlitecpp +- ssht - status-code - stb +- stlab - strawberryperl - string-view-lite - strong_type From aa5fb7ed38abbcba065ba7bbb1aabf8e622ab0fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20H=C3=A4ring?= <116002362+tim-goto@users.noreply.github.com> Date: Tue, 27 Jun 2023 14:42:01 +0200 Subject: [PATCH 09/59] (#18038) chore: update version * chore: update version * PR feedback from memsharded --- recipes/gurkenlaeufer/all/conandata.yml | 4 ++++ recipes/gurkenlaeufer/config.yml | 2 ++ 2 files changed, 6 insertions(+) diff --git a/recipes/gurkenlaeufer/all/conandata.yml b/recipes/gurkenlaeufer/all/conandata.yml index 7f1f9f96ad208..8c528ae68f26c 100644 --- a/recipes/gurkenlaeufer/all/conandata.yml +++ b/recipes/gurkenlaeufer/all/conandata.yml @@ -1,4 +1,8 @@ sources: + "1.1.0": + url: + - "https://github.com/paulelsner/gurkenlaeufer/archive/refs/tags/v1.1.0.zip" + sha256: "afa8ff520354ece11c97537ba61998b04fca02d3eda1909d112f008dd4522ba0" "1.0.1": url: - "https://github.com/paulelsner/gurkenlaeufer/archive/refs/tags/v1.0.1.zip" diff --git a/recipes/gurkenlaeufer/config.yml b/recipes/gurkenlaeufer/config.yml index 715e55357a17b..20ec1c9e2bdee 100644 --- a/recipes/gurkenlaeufer/config.yml +++ b/recipes/gurkenlaeufer/config.yml @@ -1,3 +1,5 @@ versions: + "1.1.0": + folder: all "1.0.1": folder: all From 66a0ec9859679659c337b224331cef677160c855 Mon Sep 17 00:00:00 2001 From: toge Date: Tue, 27 Jun 2023 22:10:15 +0900 Subject: [PATCH 10/59] (#17545) mppp: update fmt, fix compilation error on with_fmt=True * mppp: update fmt, fix compilation error on with_fmt=True * make gmp transitive_headers=True * update boost * Update recipes/mppp/all/conandata.yml --------- Co-authored-by: Luis Caro Campos <3535649+jcar87@users.noreply.github.com> --- recipes/mppp/all/conandata.yml | 4 ++++ recipes/mppp/all/conanfile.py | 6 +++--- .../patches/0.27-0002-remove-fmt-version.patch | 15 +++++++++++++++ 3 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 recipes/mppp/all/patches/0.27-0002-remove-fmt-version.patch diff --git a/recipes/mppp/all/conandata.yml b/recipes/mppp/all/conandata.yml index 60d10df366776..9c91fb1f269aa 100644 --- a/recipes/mppp/all/conandata.yml +++ b/recipes/mppp/all/conandata.yml @@ -10,6 +10,10 @@ patches: - patch_file: "patches/0.27-0001-disable-warning-error.patch" patch_description: "disable the flag for treats warning as errors" patch_type: "portability" + - patch_file: "patches/0.27-0002-remove-fmt-version.patch" + # https://github.com/conan-io/conan/issues/14172 + patch_description: "remove fmt version number from find_package" + patch_type: "conan" "0.26": - patch_file: "patches/0.26-0001-disable-warning-error.patch" patch_description: "disable the flag for treats warning as errors" diff --git a/recipes/mppp/all/conanfile.py b/recipes/mppp/all/conanfile.py index 4677b62f734c2..bf3dbe732b8b1 100644 --- a/recipes/mppp/all/conanfile.py +++ b/recipes/mppp/all/conanfile.py @@ -61,15 +61,15 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("gmp/6.2.1") + self.requires("gmp/6.2.1", transitive_headers=True) if self.options.with_mpfr: self.requires("mpfr/4.1.0") if self.options.with_mpc: self.requires("mpc/1.2.0") if self.options.with_boost: - self.requires("boost/1.81.0") + self.requires("boost/1.82.0") if self.options.get_safe("with_fmt"): - self.requires("fmt/9.1.0") + self.requires("fmt/10.0.0", transitive_headers=True) def validate(self): if self.settings.compiler.get_safe("cppstd"): diff --git a/recipes/mppp/all/patches/0.27-0002-remove-fmt-version.patch b/recipes/mppp/all/patches/0.27-0002-remove-fmt-version.patch new file mode 100644 index 0000000000000..28109b89756fd --- /dev/null +++ b/recipes/mppp/all/patches/0.27-0002-remove-fmt-version.patch @@ -0,0 +1,15 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 22e275f..1a97423 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -414,9 +414,8 @@ endif() + + # NOTE: need at least version 6.2 + # to print 128-bit integers. +-set(_MPPP_MIN_FMT_VERSION "6.2") + if(MPPP_WITH_FMT) +- find_package(fmt ${_MPPP_MIN_FMT_VERSION} REQUIRED CONFIG) ++ find_package(fmt REQUIRED CONFIG) + message(STATUS "fmt version: ${fmt_VERSION}") + target_link_libraries(mp++ PUBLIC fmt::fmt) + endif() From 1c77df832cf4b8b2326286ffe2c37ad0b9478830 Mon Sep 17 00:00:00 2001 From: Marian Klymov Date: Tue, 27 Jun 2023 16:44:36 +0300 Subject: [PATCH 11/59] (#16793) gdcm: add with_zlibng option --- recipes/gdcm/all/conanfile.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/recipes/gdcm/all/conanfile.py b/recipes/gdcm/all/conanfile.py index f32e56dd3a6fd..d7959e0134184 100644 --- a/recipes/gdcm/all/conanfile.py +++ b/recipes/gdcm/all/conanfile.py @@ -27,12 +27,14 @@ class GDCMConan(ConanFile): "fPIC": [True, False], "with_json": [True, False], "with_openssl": [True, False], + "with_zlibng": [True, False], } default_options = { "shared": False, "fPIC": True, "with_json": True, "with_openssl": True, + "with_zlibng": False, } @property @@ -56,7 +58,10 @@ def layout(self): def requirements(self): self.requires("expat/2.5.0") self.requires("openjpeg/2.5.0") - self.requires("zlib/1.2.13") + if self.options.with_zlibng: + self.requires("zlib-ng/2.0.7") + else: + self.requires("zlib/1.2.13") if self.settings.os != "Windows": self.requires("libuuid/1.0.3") if Version(self.version) >= Version("3.0.20"): @@ -71,6 +76,10 @@ def validate(self): check_min_cppstd(self, self._min_cppstd) if is_msvc_static_runtime(self) and self.options.shared: raise ConanInvalidConfiguration(f"{self.ref} does not support shared and static runtime together.") + if self.info.options.with_zlibng: + zlib_ng = self.dependencies["zlib-ng"] + if not zlib_ng.options.zlib_compat: + raise ConanInvalidConfiguration(f"{self.ref} requires the dependency option zlib-ng:zlib_compat=True") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -222,7 +231,11 @@ def package_info(self): if self.options.with_openssl: self.cpp_info.components["gdcmCommon"].requires.append("openssl::openssl") - self.cpp_info.components["gdcmDSED"].requires.extend(["gdcmCommon", "zlib::zlib"]) + + def zlib(): + return "zlib-ng::zlib-ng" if self.options.with_zlibng else "zlib::zlib" + + self.cpp_info.components["gdcmDSED"].requires.extend(["gdcmCommon", zlib()]) self.cpp_info.components["gdcmIOD"].requires.extend(["gdcmDSED", "gdcmCommon", "expat::expat"]) self.cpp_info.components["gdcmMSFF"].requires.extend(["gdcmIOD", "gdcmDSED", "gdcmDICT", "openjpeg::openjpeg"]) if self.options.with_json: From 103b4f16beffbe0b7f8c19ea8328b484c01d18ad Mon Sep 17 00:00:00 2001 From: Martin Delille Date: Tue, 27 Jun 2023 19:05:56 +0200 Subject: [PATCH 12/59] (#18074) [sentry-breakpad] Update to 0.6.4 --- recipes/sentry-breakpad/all/conandata.yml | 6 +++--- recipes/sentry-breakpad/config.yml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/recipes/sentry-breakpad/all/conandata.yml b/recipes/sentry-breakpad/all/conandata.yml index 059f423b2eba7..17d89711effcc 100644 --- a/recipes/sentry-breakpad/all/conandata.yml +++ b/recipes/sentry-breakpad/all/conandata.yml @@ -1,13 +1,13 @@ sources: + "0.6.4": + url: "https://github.com/getsentry/sentry-native/releases/download/0.6.4/sentry-native.zip" + sha256: "e00278bf9a4821bb4008985a5a552a84aba6ebb06d3f9e828082fcbf06b04a38" "0.6.3": url: "https://github.com/getsentry/sentry-native/releases/download/0.6.3/sentry-native.zip" sha256: "6b515c17a9b860ea47c6a5fd7abdfdc89b4b8cbc654c23a8bb42a39bfcb87ad9" "0.6.2": url: "https://github.com/getsentry/sentry-native/releases/download/0.6.2/sentry-native.zip" sha256: "9b9f4b2cec961ca132039c7887fb876b3dd6f4795b31ca01d188187f69758efa" - "0.6.1": - url: "https://github.com/getsentry/sentry-native/releases/download/0.6.1/sentry-native.zip" - sha256: "47527a3513db141affb8af28a0b8d886f78348a65acd2110d7eed936e3d82954" "0.5.4": url: "https://github.com/getsentry/sentry-native/releases/download/0.5.4/sentry-native.zip" sha256: "e151bdc76894eb964ba4637361b2a96b7447fb04212053cf695fd7f72b636e4d" diff --git a/recipes/sentry-breakpad/config.yml b/recipes/sentry-breakpad/config.yml index 205b96ca25c22..fb99bc2eb64b8 100644 --- a/recipes/sentry-breakpad/config.yml +++ b/recipes/sentry-breakpad/config.yml @@ -1,10 +1,10 @@ versions: + "0.6.4": + folder: all "0.6.3": folder: all "0.6.2": folder: all - "0.6.1": - folder: all "0.5.4": folder: all "0.4.18": From 79694aa1c672d8642d55eef13ab8709227a491fa Mon Sep 17 00:00:00 2001 From: toge Date: Wed, 28 Jun 2023 02:42:13 +0900 Subject: [PATCH 13/59] (#18087) simde: add recipe --- recipes/simde/all/conandata.yml | 4 ++ recipes/simde/all/conanfile.py | 48 +++++++++++++++++++ recipes/simde/all/test_package/CMakeLists.txt | 8 ++++ recipes/simde/all/test_package/conanfile.py | 26 ++++++++++ recipes/simde/all/test_package/test_package.c | 26 ++++++++++ recipes/simde/config.yml | 3 ++ 6 files changed, 115 insertions(+) create mode 100644 recipes/simde/all/conandata.yml create mode 100644 recipes/simde/all/conanfile.py create mode 100644 recipes/simde/all/test_package/CMakeLists.txt create mode 100644 recipes/simde/all/test_package/conanfile.py create mode 100644 recipes/simde/all/test_package/test_package.c create mode 100644 recipes/simde/config.yml diff --git a/recipes/simde/all/conandata.yml b/recipes/simde/all/conandata.yml new file mode 100644 index 0000000000000..dd4d7915e803f --- /dev/null +++ b/recipes/simde/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.7.6": + url: "https://github.com/simd-everywhere/simde/archive/refs/tags/v0.7.6.tar.gz" + sha256: "c63e6c61392e324728da1c7e5de308cb31410908993a769594f5e21ff8de962b" diff --git a/recipes/simde/all/conanfile.py b/recipes/simde/all/conanfile.py new file mode 100644 index 0000000000000..c69a65a98ab60 --- /dev/null +++ b/recipes/simde/all/conanfile.py @@ -0,0 +1,48 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import get, copy +from conan.tools.layout import basic_layout +import os + + +required_conan_version = ">=1.52.0" + + +class SIMEeConan(ConanFile): + name = "simde" + description = "Implementations of SIMD instruction sets for systems which don't natively support them." + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/simd-everywhere/simde" + topics = ("neon", "avx", "sse", "simd", "header-only") + package_type = "header-library" + 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 validate(self): + if self.settings.arch not in ["x86", "x86_64", "armv8"] or self.settings.os == "Emscripten": + raise ConanInvalidConfiguration(f"{self.ref} supports x86, x86_64, armv8 only or emscriptien.") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def package(self): + copy(self, pattern="COPYING", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy( + self, + pattern="*.h", + dst=os.path.join(self.package_folder, "include", "simde"), + src=os.path.join(self.source_folder, "simde"), + ) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + self.cpp_info.set_property("pkg_config_name", "SIMDe") diff --git a/recipes/simde/all/test_package/CMakeLists.txt b/recipes/simde/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..142cf36ac18b4 --- /dev/null +++ b/recipes/simde/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) + +find_package(simde REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE simde::simde) +target_compile_features(${PROJECT_NAME} PRIVATE c_std_99) diff --git a/recipes/simde/all/test_package/conanfile.py b/recipes/simde/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3a91c9439218e --- /dev/null +++ b/recipes/simde/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.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/simde/all/test_package/test_package.c b/recipes/simde/all/test_package/test_package.c new file mode 100644 index 0000000000000..7257838559828 --- /dev/null +++ b/recipes/simde/all/test_package/test_package.c @@ -0,0 +1,26 @@ +#include +#include + +int main(void) { + simde__m128i a = simde_mm_set_epi8( + INT8_C(-105), INT8_C(-116), INT8_C( -45), INT8_C(-102), + INT8_C( -3), INT8_C( 92), INT8_C( -99), INT8_C( 100), + INT8_C( 30), INT8_C(-115), INT8_C( 82), INT8_C( 84), + INT8_C(-106), INT8_C( 66), INT8_C(-107), INT8_C( 116) + ); + int la = 0; + simde__m128i b = simde_mm_set_epi8( + INT8_C( -89), INT8_C( 65), INT8_C( 68), INT8_C( -29), + INT8_C(-101), INT8_C( 113), INT8_C( -11), INT8_C( 53), + INT8_C( -5), INT8_C( -76), INT8_C( 28), INT8_C(-120), + INT8_C( 64), INT8_C( 43), INT8_C(-127), INT8_C( -44) + ); + int lb = 2; + int r = simde_mm_cmpestrs(a, la, b, lb, 0); + + if (r != 1) { + return 1; + } + + return 0; +} diff --git a/recipes/simde/config.yml b/recipes/simde/config.yml new file mode 100644 index 0000000000000..1d3599e3efc2e --- /dev/null +++ b/recipes/simde/config.yml @@ -0,0 +1,3 @@ +versions: + "0.7.6": + folder: all From a066c41e1d66c6b6aeb48a1925e516aede79e2f3 Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Tue, 27 Jun 2023 20:03:50 +0200 Subject: [PATCH 14/59] (#17993) [sqlpp11] Support Conan v2 and add version 0.62 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update sqlpp11 to 0.62 Signed-off-by: Uilian Ries * add test_v1_package Signed-off-by: Uilian Ries * remove comment Signed-off-by: Uilian Ries * fix config.yml Signed-off-by: Uilian Ries * fix target name Signed-off-by: Uilian Ries * Update recipes/sqlpp11/all/conanfile.py Co-authored-by: Rubén Rincón Blanco --------- Signed-off-by: Uilian Ries Co-authored-by: Rubén Rincón Blanco Co-authored-by: Rubén Rincón Blanco --- recipes/sqlpp11/all/conandata.yml | 15 ++--- recipes/sqlpp11/all/conanfile.py | 62 +++++++++---------- .../sqlpp11/all/test_package/CMakeLists.txt | 15 ++--- recipes/sqlpp11/all/test_package/conanfile.py | 22 +++++-- recipes/sqlpp11/all/test_package/example.cpp | 6 -- .../sqlpp11/all/test_package/test_package.cpp | 8 +++ .../all/test_v1_package/CMakeLists.txt | 8 +++ .../sqlpp11/all/test_v1_package/conanfile.py | 19 ++++++ recipes/sqlpp11/config.yml | 6 +- 9 files changed, 96 insertions(+), 65 deletions(-) delete mode 100644 recipes/sqlpp11/all/test_package/example.cpp create mode 100644 recipes/sqlpp11/all/test_package/test_package.cpp create mode 100644 recipes/sqlpp11/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/sqlpp11/all/test_v1_package/conanfile.py diff --git a/recipes/sqlpp11/all/conandata.yml b/recipes/sqlpp11/all/conandata.yml index 08915d57967e4..a54e77da8a340 100644 --- a/recipes/sqlpp11/all/conandata.yml +++ b/recipes/sqlpp11/all/conandata.yml @@ -1,13 +1,10 @@ sources: - "0.58": - url: "https://github.com/rbock/sqlpp11/archive/0.58.zip" - sha256: 8e2ba487b7a0ddc988bcfa5366443a0f5ca9f38ef86ac8e3f257801ab3cbf8eb - "0.59": - url: "https://github.com/rbock/sqlpp11/archive/0.59.zip" - sha256: 62ba9ba078e05901aa47cb056240bb474f9b8ef5cabf114f8219b4a6fa4f019b - "0.60": - url: "https://github.com/rbock/sqlpp11/archive/0.60.zip" - sha256: 27ccc750d5eb8f234445e26e41d53d72c9df329eb2b30d64dbf21078ae57c52c + "0.62": + url: "https://github.com/rbock/sqlpp11/archive/0.62.tar.gz" + sha256: "6d8326e94c5b14a863ead15688d853ab7854136caa9ebc47389a833fe79db7c5" "0.61": url: "https://github.com/rbock/sqlpp11/archive/0.61.tar.gz" sha256: "d5a95e28ae93930f7701f517b1342ac14bcf33a9b1c5b5f0dff6aea5e315bb50" + "0.60": + url: "https://github.com/rbock/sqlpp11/archive/0.60.zip" + sha256: 27ccc750d5eb8f234445e26e41d53d72c9df329eb2b30d64dbf21078ae57c52c diff --git a/recipes/sqlpp11/all/conanfile.py b/recipes/sqlpp11/all/conanfile.py index 384cf91a4b695..9ada1d6896ced 100644 --- a/recipes/sqlpp11/all/conanfile.py +++ b/recipes/sqlpp11/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.layout import basic_layout +from conan.tools.files import get, copy +from conan import Version import os -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.53.0" class Sqlpp11Conan(ConanFile): @@ -12,60 +16,56 @@ class Sqlpp11Conan(ConanFile): homepage = "https://github.com/rbock/sqlpp11" description = "A type safe SQL template library for C++" topics = ("sql", "dsl", "embedded", "data-base") + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True - @property - def _source_subfolder(self): - return "source_subfolder" @property - def _min_stdcpp_version(self): - return 11 if tools.Version(self.version) < "0.61" else 14 + def _min_cppstd(self): + return 11 if Version(self.version) < "0.61" else 14 @property def _compilers_minimum_version(self): return { "gcc": "5", "Visual Studio": "14", + "msvc": "190", "clang": "3.4", "apple-clang": "10", } + def layout(self): + basic_layout(self, src_folder="src") + def requirements(self): self.requires("date/3.0.1") - def validate(self): - if self.settings.compiler.cppstd: - tools.check_min_cppstd(self, self._min_stdcpp_version) - - if self._min_stdcpp_version > 11: - minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) - if minimum_version: - if tools.Version(self.settings.compiler.version) < minimum_version: - raise ConanInvalidConfiguration(f"{self.name} requires C++14, which your compiler does not support.") - else: - self.output.warn(f"{self.name} requires C++14. Your compiler is unknown. Assuming it supports C++14.") - def package_id(self): - self.info.header_only() + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration(f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support.") def source(self): - tools.get( - **self.conan_data["sources"][self.version], - destination=self._source_subfolder, - strip_root=True - ) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def package(self): - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) - self.copy("*.h", dst="include", src=os.path.join(self._source_subfolder, "include")) - self.copy("*", dst="bin", src=os.path.join(self._source_subfolder, "scripts")) + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, "*.h", dst=os.path.join(self.package_folder, "include"), src=os.path.join(self.source_folder, "include")) + copy(self, "*", dst=os.path.join(self.package_folder, "bin"), src=os.path.join(self.source_folder, "scripts")) def package_info(self): - self.cpp_info.filenames["cmake_find_package"] = "Sqlpp11" - self.cpp_info.filenames["cmake_find_package_multi"] = "Sqlpp11" + self.cpp_info.libdirs = [] + + self.cpp_info.set_property("cmake_file_name", "Sqlpp11") + self.cpp_info.set_property("cmake_target_name", "sqlpp11::sqlpp11") + # TODO: to remove in conan v2 once cmake_find_package_* generators removed 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/sqlpp11/all/test_package/CMakeLists.txt b/recipes/sqlpp11/all/test_package/CMakeLists.txt index 209e56f42630d..6c3b3cedf8364 100644 --- a/recipes/sqlpp11/all/test_package/CMakeLists.txt +++ b/recipes/sqlpp11/all/test_package/CMakeLists.txt @@ -1,11 +1,8 @@ -cmake_minimum_required(VERSION 3.1) -project(PackageTest CXX) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +find_package(Sqlpp11 REQUIRED CONFIG) -find_package(Sqlpp11 CONFIG REQUIRED) - -add_executable(example example.cpp) -set_property(TARGET example PROPERTY CXX_STANDARD 14) -target_link_libraries(example sqlpp11::sqlpp11) +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE sqlpp11::sqlpp11) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/sqlpp11/all/test_package/conanfile.py b/recipes/sqlpp11/all/test_package/conanfile.py index 11eb01c13ada3..3a91c9439218e 100644 --- a/recipes/sqlpp11/all/test_package/conanfile.py +++ b/recipes/sqlpp11/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 Sqlpp11TestConan(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 layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -12,5 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self.settings): - self.run(os.path.join("bin", "example"), 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/sqlpp11/all/test_package/example.cpp b/recipes/sqlpp11/all/test_package/example.cpp deleted file mode 100644 index 9b0644427156d..0000000000000 --- a/recipes/sqlpp11/all/test_package/example.cpp +++ /dev/null @@ -1,6 +0,0 @@ -#include - -int main() -{ - sqlpp::connection c; -} diff --git a/recipes/sqlpp11/all/test_package/test_package.cpp b/recipes/sqlpp11/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..aa306d637efdd --- /dev/null +++ b/recipes/sqlpp11/all/test_package/test_package.cpp @@ -0,0 +1,8 @@ +#include +#include +#include + +int main() { + select(sqlpp::value(false).as(sqlpp::alias::a)); + return EXIT_SUCCESS; +} diff --git a/recipes/sqlpp11/all/test_v1_package/CMakeLists.txt b/recipes/sqlpp11/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/sqlpp11/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/sqlpp11/all/test_v1_package/conanfile.py b/recipes/sqlpp11/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..37ada808989d9 --- /dev/null +++ b/recipes/sqlpp11/all/test_v1_package/conanfile.py @@ -0,0 +1,19 @@ +import os + +from conan.tools.build import cross_building +from conans import ConanFile, CMake + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/sqlpp11/config.yml b/recipes/sqlpp11/config.yml index a51d2c88cb4ae..c35347d804ef3 100644 --- a/recipes/sqlpp11/config.yml +++ b/recipes/sqlpp11/config.yml @@ -1,9 +1,7 @@ versions: - "0.58": + "0.62": folder: "all" - "0.59": + "0.61": folder: "all" "0.60": folder: "all" - "0.61": - folder: "all" From ddf81556b682470417a33db72a285a1dcdbe07ed Mon Sep 17 00:00:00 2001 From: qwqbot Date: Wed, 28 Jun 2023 13:21:41 +0800 Subject: [PATCH 15/59] (#18097) tracy: add version 0.9.1 --- recipes/tracy/all/conandata.yml | 3 +++ recipes/tracy/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/tracy/all/conandata.yml b/recipes/tracy/all/conandata.yml index 266a1ecb7f6b1..e66204ae4d119 100644 --- a/recipes/tracy/all/conandata.yml +++ b/recipes/tracy/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.9.1": + url: "https://github.com/wolfpld/tracy/archive/refs/tags/v0.9.1.tar.gz" + sha256: "c2de9f35ab2a516a9689ff18f5b62a55b73b93b66514bd09ba013d7957993cd7" "0.9": url: "https://github.com/wolfpld/tracy/archive/refs/tags/v0.9.tar.gz" sha256: "93a91544e3d88f3bc4c405bad3dbc916ba951cdaadd5fcec1139af6fa56e6bfc" diff --git a/recipes/tracy/config.yml b/recipes/tracy/config.yml index 77aaa018b1794..6bea7d9080e33 100644 --- a/recipes/tracy/config.yml +++ b/recipes/tracy/config.yml @@ -1,4 +1,6 @@ versions: + "0.9.1": + folder: all "0.9": folder: all "0.8.2.1": From 678acf3ac2d7003285880da1cbc3506f6a85eef0 Mon Sep 17 00:00:00 2001 From: FireWolf <10460478+0xFireWolf@users.noreply.github.com> Date: Tue, 27 Jun 2023 22:43:13 -0700 Subject: [PATCH 16/59] (#17752) wolfssl: Add version 5.6.0. * wolfssl: Add version 5.6.0. * wolfssl: Link against the frameworks, `CoreFoundation` and `Security` when building the static library for Apple platforms. * wolfssl: Add `crypt32` to the list of system libraries. * wolfssl: Add `crypt32` to the list of system libraries and add `CoreFoundation` and `Security` to the list of frameworks as of v5.6.0. * bump to 5.6.2 * Update config.yml * bump one more minor for windows fixes https://github.com/wolfSSL/wolfssl/releases/tag/v5.6.3-stable * Update config.yml --------- Co-authored-by: Carlos Zoido Co-authored-by: Chris Mc --- recipes/wolfssl/all/conandata.yml | 3 +++ recipes/wolfssl/all/conanfile.py | 7 ++++++- recipes/wolfssl/config.yml | 2 ++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/recipes/wolfssl/all/conandata.yml b/recipes/wolfssl/all/conandata.yml index 9f6956c1ef7de..45f769c905838 100644 --- a/recipes/wolfssl/all/conandata.yml +++ b/recipes/wolfssl/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "5.6.3": + url: "https://github.com/wolfSSL/wolfssl/archive/v5.6.3-stable.tar.gz" + sha256: "2e74a397fa797c2902d7467d500de904907666afb4ff80f6464f6efd5afb114a" "5.5.1": url: "https://github.com/wolfSSL/wolfssl/archive/v5.5.1-stable.tar.gz" sha256: "97339e6956c90e7c881ba5c748dd04f7c30e5dbe0c06da765418c51375a6dee3" diff --git a/recipes/wolfssl/all/conanfile.py b/recipes/wolfssl/all/conanfile.py index d1489495db5d2..7233278df2e56 100644 --- a/recipes/wolfssl/all/conanfile.py +++ b/recipes/wolfssl/all/conanfile.py @@ -1,11 +1,12 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration -from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.apple import fix_apple_shared_install_name, is_apple_os from conan.tools.env import VirtualBuildEnv from conan.tools.files import copy, get, rename, rm, rmdir from conan.tools.gnu import Autotools, AutotoolsToolchain from conan.tools.layout import basic_layout from conan.tools.microsoft import check_min_vs, is_msvc, unix_path +from conan.tools.scm import Version import os required_conan_version = ">=1.54.0" @@ -157,3 +158,7 @@ def package_info(self): self.cpp_info.system_libs.extend(["m", "pthread"]) elif self.settings.os == "Windows": self.cpp_info.system_libs.extend(["advapi32", "ws2_32"]) + if Version(self.version) >= "5.6.0": + self.cpp_info.system_libs.append("crypt32") + elif is_apple_os(self) and Version(self.version) >= "5.6.0": + self.cpp_info.frameworks.extend(["CoreFoundation", "Security"]) diff --git a/recipes/wolfssl/config.yml b/recipes/wolfssl/config.yml index e4db787180ac0..92091015e6a56 100644 --- a/recipes/wolfssl/config.yml +++ b/recipes/wolfssl/config.yml @@ -1,4 +1,6 @@ versions: + "5.6.3": + folder: all "5.5.1": folder: all "5.4.0": From da57fda7db6ac6c2022ba2f6483bca74470492b8 Mon Sep 17 00:00:00 2001 From: toge Date: Wed, 28 Jun 2023 17:23:41 +0900 Subject: [PATCH 17/59] (#17408) sonic-cpp: add recipe MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * sonic-cpp: add recipe * remove options * support older gcc * always required string-view-lite with TODO comment * add mpclmul for apple-clang * Update recipes/sonic-cpp/all/conanfile.py * Update recipes/sonic-cpp/all/conanfile.py * Update recipes/sonic-cpp/all/conanfile.py * Update recipes/sonic-cpp/all/conanfile.py * Update recipes/sonic-cpp/all/conanfile.py * Update recipes/sonic-cpp/all/conanfile.py * check_max_cppstd was not backported --------- Co-authored-by: Uilian Ries Co-authored-by: Rubén Rincón Blanco Co-authored-by: Rubén Rincón --- recipes/sonic-cpp/all/conandata.yml | 9 +++ recipes/sonic-cpp/all/conanfile.py | 79 +++++++++++++++++++ .../all/patches/1.0.0-0001-use-cci.patch | 13 +++ .../sonic-cpp/all/test_package/CMakeLists.txt | 8 ++ .../sonic-cpp/all/test_package/conanfile.py | 26 ++++++ .../all/test_package/test_package.cpp | 23 ++++++ .../all/test_v1_package/CMakeLists.txt | 8 ++ .../all/test_v1_package/conanfile.py | 18 +++++ recipes/sonic-cpp/config.yml | 3 + 9 files changed, 187 insertions(+) create mode 100644 recipes/sonic-cpp/all/conandata.yml create mode 100644 recipes/sonic-cpp/all/conanfile.py create mode 100644 recipes/sonic-cpp/all/patches/1.0.0-0001-use-cci.patch create mode 100644 recipes/sonic-cpp/all/test_package/CMakeLists.txt create mode 100644 recipes/sonic-cpp/all/test_package/conanfile.py create mode 100644 recipes/sonic-cpp/all/test_package/test_package.cpp create mode 100644 recipes/sonic-cpp/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/sonic-cpp/all/test_v1_package/conanfile.py create mode 100644 recipes/sonic-cpp/config.yml diff --git a/recipes/sonic-cpp/all/conandata.yml b/recipes/sonic-cpp/all/conandata.yml new file mode 100644 index 0000000000000..d309d05a897b8 --- /dev/null +++ b/recipes/sonic-cpp/all/conandata.yml @@ -0,0 +1,9 @@ +sources: + "1.0.0": + url: "https://github.com/bytedance/sonic-cpp/archive/refs/tags/v1.0.0.tar.gz" + sha256: "78af626fa070a2702fe9586d90617292b421d97d7ab1fe27a02cc20434467a80" +patches: + "1.0.0": + - patch_file: "patches/1.0.0-0001-use-cci.patch" + patch_description: "use cci recipes" + patch_type: "conan" diff --git a/recipes/sonic-cpp/all/conanfile.py b/recipes/sonic-cpp/all/conanfile.py new file mode 100644 index 0000000000000..8490a3d80c51b --- /dev/null +++ b/recipes/sonic-cpp/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 apply_conandata_patches, export_conandata_patches, get, copy +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc +import os + +required_conan_version = ">=1.53.0" + + +class SonicCppConan(ConanFile): + name = "sonic-cpp" + description = "A fast JSON serializing & deserializing library, accelerated by SIMD." + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/bytedance/sonic-cpp" + topics = ("json", "parser", "writer", "serializer", "deserializer", "header-only") + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + + @property + def _min_cppstd(self): + return 11 + + def export_sources(self): + export_conandata_patches(self) + + def layout(self): + basic_layout(self, src_folder="src") + + @property + def _compilers_minimum_version(self): + return { + "gcc": "8", + "clang": "7", + "apple-clang": "12", + } + + def requirements(self): + cppstd = self.settings.get_safe("compiler.cppstd") + # Assume we would need it if not told otherwise + if not cppstd or cppstd < "17": + self.requires("string-view-lite/1.7.0") + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) + + if self.settings.arch not in ["x86", "x86_64"]: + raise ConanInvalidConfiguration(f"{self.ref} support x86, x86_64 only.") + + if is_msvc(self): + raise ConanInvalidConfiguration(f"{self.ref} doesn't support MSVC now.") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def build(self): + apply_conandata_patches(self) + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy( + self, + pattern="*.h", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "include"), + ) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + if self.settings.compiler in ["gcc", "clang", "apple-clang"]: + self.cpp_info.cxxflags.extend(["-mavx2", "-mpclmul"]) diff --git a/recipes/sonic-cpp/all/patches/1.0.0-0001-use-cci.patch b/recipes/sonic-cpp/all/patches/1.0.0-0001-use-cci.patch new file mode 100644 index 0000000000000..340323cf63a9a --- /dev/null +++ b/recipes/sonic-cpp/all/patches/1.0.0-0001-use-cci.patch @@ -0,0 +1,13 @@ +diff --git a/include/sonic/string_view.h b/include/sonic/string_view.h +index 67dfe2f..1fb2379 100644 +--- a/include/sonic/string_view.h ++++ b/include/sonic/string_view.h +@@ -21,7 +21,7 @@ namespace sonic_json { + using StringView = std::string_view; + } // namespace sonic_json + #else +-#include "thirdparty/string-view-lite/string_view.h" ++#include "nonstd/string_view.hpp" + namespace sonic_json { + using StringView = nonstd::string_view; + } // namespace sonic_json diff --git a/recipes/sonic-cpp/all/test_package/CMakeLists.txt b/recipes/sonic-cpp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..2af5927a3f12f --- /dev/null +++ b/recipes/sonic-cpp/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(sonic-cpp REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE sonic-cpp::sonic-cpp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/sonic-cpp/all/test_package/conanfile.py b/recipes/sonic-cpp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/sonic-cpp/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/sonic-cpp/all/test_package/test_package.cpp b/recipes/sonic-cpp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..384ea13453551 --- /dev/null +++ b/recipes/sonic-cpp/all/test_package/test_package.cpp @@ -0,0 +1,23 @@ +#include "sonic/sonic.h" + +#include +#include + +int main() +{ + std::string json = R"( + { + "a": 1, + "b": 2 + } + )"; + + sonic_json::Document doc; + doc.Parse(json); + if (doc.HasParseError()) { + std::cout << "Parse failed!\n"; + } else { + std::cout << "Parse successful!\n"; + } + return 0; +} diff --git a/recipes/sonic-cpp/all/test_v1_package/CMakeLists.txt b/recipes/sonic-cpp/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..be00a8c7f57c7 --- /dev/null +++ b/recipes/sonic-cpp/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/sonic-cpp/all/test_v1_package/conanfile.py b/recipes/sonic-cpp/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/sonic-cpp/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/sonic-cpp/config.yml b/recipes/sonic-cpp/config.yml new file mode 100644 index 0000000000000..40341aa3db6cd --- /dev/null +++ b/recipes/sonic-cpp/config.yml @@ -0,0 +1,3 @@ +versions: + "1.0.0": + folder: all From 9223549a5c0db032d5d9bf05f1614d3593c0c443 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Wed, 28 Jun 2023 10:43:57 +0200 Subject: [PATCH 18/59] (#17274) sentry-native: bump dependencies and use version range for openssl & cmake * bump dependencies and use version range for openssl & cmake * disable tests & examples * use cppstd 17 with visual * is msvc * fix --------- Co-authored-by: Daniel --- recipes/sentry-native/all/conanfile.py | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/recipes/sentry-native/all/conanfile.py b/recipes/sentry-native/all/conanfile.py index 888d98c0fe1ef..ed2d0e353f83d 100644 --- a/recipes/sentry-native/all/conanfile.py +++ b/recipes/sentry-native/all/conanfile.py @@ -6,6 +6,7 @@ from conan.tools.env import VirtualBuildEnv from conan.tools.files import copy, get, rm, rmdir, export_conandata_patches, apply_conandata_patches from conan.tools.gnu import PkgConfigDeps +from conan.tools.microsoft import is_msvc from conan.tools.scm import Version import os @@ -49,6 +50,8 @@ class SentryNativeConan(ConanFile): @property def _min_cppstd(self): + if is_msvc(self): + return "17" return "14" @property @@ -103,7 +106,7 @@ def layout(self): def requirements(self): if self.options.transport == "curl": - self.requires("libcurl/7.87.0") + self.requires("libcurl/8.0.1") if self.options.backend == "crashpad": if self.options.with_crashpad == "sentry": self.requires(f"sentry-crashpad/{self.version}") @@ -115,8 +118,8 @@ def requirements(self): if self.options.with_breakpad == "google": self.requires("breakpad/cci.20210521") if self.options.get_safe("qt"): - self.requires("qt/5.15.8") - self.requires("openssl/1.1.1t") + self.requires("qt/5.15.9") + self.requires("openssl/[>=1.1 <4]") def validate(self): if self.settings.compiler.get_safe("cppstd"): @@ -132,20 +135,9 @@ def validate(self): if self.settings.compiler == "apple-clang" and Version(self.settings.compiler.version) < "10.0": raise ConanInvalidConfiguration("apple-clang < 10.0 not supported") - def _cmake_new_enough(self, required_version): - try: - import re - from io import StringIO - output = StringIO() - self.run("cmake --version", 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.settings.os == "Windows" and not self._cmake_new_enough("3.16.4"): - self.tool_requires("cmake/3.25.2") + if self.settings.os == "Windows": + self.tool_requires("cmake/[>=3.16.4 <4]") if self.options.backend == "breakpad": if not self.conf.get("tools.gnu:pkg_config", check_type=str): self.tool_requires("pkgconf/1.9.3") @@ -162,6 +154,8 @@ def generate(self): tc.variables["SENTRY_ENABLE_INSTALL"] = True tc.variables["SENTRY_TRANSPORT"] = self.options.transport tc.variables["SENTRY_PIC"] = self.options.get_safe("fPIC", True) + tc.variables["SENTRY_BUILD_TESTS"] = False + tc.variables["SENTRY_BUILD_EXAMPLES"] = False tc.variables["SENTRY_INTEGRATION_QT"] = self.options.qt if self.options.get_safe("wer", False): tc.variables["CRASHPAD_WER_ENABLED"] = True From 67510b050a3387a8f48aac5294ce320d7adfa941 Mon Sep 17 00:00:00 2001 From: Conan Center Index Bot <54393557+conan-center-bot@users.noreply.github.com> Date: Wed, 28 Jun 2023 11:22:02 +0200 Subject: [PATCH 19/59] (#18099) [bot] Update list of references (prod-v2/ListPackages) --- .c3i/conan_v2_ready_references.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.c3i/conan_v2_ready_references.yml b/.c3i/conan_v2_ready_references.yml index f8f7e6a8086d5..fe68488eaa9b1 100644 --- a/.c3i/conan_v2_ready_references.yml +++ b/.c3i/conan_v2_ready_references.yml @@ -222,6 +222,7 @@ required_for_references: - emio - enet - entityx +- entt - enum-flags - erikzenker-hsm - erkir @@ -485,11 +486,13 @@ required_for_references: - mdnsresponder - mdspan - meson +- metis - mgs - microservice-essentials - mikelankamp-fpm - mimalloc - miniaudio +- minimp3 - minisat - minizip - minizip-ng @@ -499,6 +502,7 @@ required_for_references: - mozjpeg - mp-units - mpg123 +- mppp - ms-gsl - msgpack-c - msgpack-cxx @@ -574,6 +578,7 @@ required_for_references: - prometheus-cpp - proposal - protobuf +- protobuf-c - psimd - pthreadpool - pthreads4w @@ -628,6 +633,7 @@ required_for_references: - sfml - shield - sigslot +- simde - simdjson - simdutf - skyr-url @@ -645,6 +651,7 @@ required_for_references: - sqlite3 - sqlite_orm - sqlitecpp +- sqlpp11 - ssht - status-code - stb From 7823553ecaa4036da2ae39bb42398cf6d084d7c2 Mon Sep 17 00:00:00 2001 From: toge Date: Wed, 28 Jun 2023 21:43:06 +0900 Subject: [PATCH 20/59] (#18098) simde: supports all platforms MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Rubén Rincón Blanco --- recipes/simde/all/conandata.yml | 2 ++ recipes/simde/all/conanfile.py | 35 ++++++++++++++++++++++----------- 2 files changed, 25 insertions(+), 12 deletions(-) diff --git a/recipes/simde/all/conandata.yml b/recipes/simde/all/conandata.yml index dd4d7915e803f..c108fd42332f1 100644 --- a/recipes/simde/all/conandata.yml +++ b/recipes/simde/all/conandata.yml @@ -1,4 +1,6 @@ sources: "0.7.6": + # A release tarball exists, but I want to use the archive tarball. + # Because the release tarball has only amalgatated(with lots of duplicate lines) header files. url: "https://github.com/simd-everywhere/simde/archive/refs/tags/v0.7.6.tar.gz" sha256: "c63e6c61392e324728da1c7e5de308cb31410908993a769594f5e21ff8de962b" diff --git a/recipes/simde/all/conanfile.py b/recipes/simde/all/conanfile.py index c69a65a98ab60..9ede298cf49ed 100644 --- a/recipes/simde/all/conanfile.py +++ b/recipes/simde/all/conanfile.py @@ -1,10 +1,10 @@ from conan import ConanFile -from conan.errors import ConanInvalidConfiguration -from conan.tools.files import get, copy +from conan.tools.files import copy, get, rmdir +from conan.tools.gnu import PkgConfigDeps from conan.tools.layout import basic_layout +from conan.tools.meson import Meson, MesonToolchain import os - required_conan_version = ">=1.52.0" @@ -25,21 +25,32 @@ def layout(self): def package_id(self): self.info.clear() - def validate(self): - if self.settings.arch not in ["x86", "x86_64", "armv8"] or self.settings.os == "Emscripten": - raise ConanInvalidConfiguration(f"{self.ref} supports x86, x86_64, armv8 only or emscriptien.") + def build_requirements(self): + self.tool_requires("meson/1.1.1") + if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): + self.tool_requires("pkgconf/1.9.3") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) + def generate(self): + tc = MesonToolchain(self) + tc.project_options["tests"] = False + tc.generate() + pkg = PkgConfigDeps(self) + pkg.generate() + + def build(self): + meson = Meson(self) + meson.configure() + meson.build() + def package(self): copy(self, pattern="COPYING", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) - copy( - self, - pattern="*.h", - dst=os.path.join(self.package_folder, "include", "simde"), - src=os.path.join(self.source_folder, "simde"), - ) + meson = Meson(self) + meson.install() + + rmdir(self, os.path.join(self.package_folder, "lib")) def package_info(self): self.cpp_info.bindirs = [] From 2a7137a4a843a073a0735221363bdce242b47614 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Wed, 28 Jun 2023 14:01:56 +0100 Subject: [PATCH 21/59] (#18093) continuable: migrate to Conan v2 * continuable: migrate to Conan v2 * continuable: restore option descriptions --- recipes/continuable/all/conanfile.py | 125 +++++++++++------- .../all/test_package/CMakeLists.txt | 13 +- .../continuable/all/test_package/conanfile.py | 21 ++- .../all/test_package/test_package.cpp | 2 +- 4 files changed, 101 insertions(+), 60 deletions(-) diff --git a/recipes/continuable/all/conanfile.py b/recipes/continuable/all/conanfile.py index 7a8754a12145a..40af36527241e 100644 --- a/recipes/continuable/all/conanfile.py +++ b/recipes/continuable/all/conanfile.py @@ -1,35 +1,33 @@ import os -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 - -required_conan_version = ">=1.28.0" +required_conan_version = ">=1.52.0" class ContinuableConan(ConanFile): name = "continuable" - description = "C++14 asynchronous allocation aware futures (supporting then, exception handling, coroutines and connections)" - topics = "asynchronous", "future", "coroutines", "header-only" + description = ( + "C++14 asynchronous allocation aware futures " + "(supporting then, exception handling, coroutines and connections)" + ) + license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/Naios/continuable" - license = "MIT" - settings = "os", "compiler" - no_copy_source = True - requires = ( - "function2/4.1.0", - ) + topics = ("asynchronous", "future", "coroutines", "header-only") + + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" options = { - # Exceptions are disabled and `std::error_condition` is used as error_type. See tutorial-chaining-continuables-fail for details. "no_exceptions": [True, False], - # Exceptions are disabled and the type defined by `CONTINUABLE_WITH_CUSTOM_ERROR_TYPE` is used as error_type. - # See tutorial-chaining-continuables-fail for details. "custom_error_type": [True, False], - # Allows unhandled exceptions in asynchronous call hierarchies. See tutorial-chaining-continuables-fail for details. "unhandled_exceptions": [True, False], - # Allows to customize the final callback which can be used to implement custom unhandled asynchronous exception handlers. "custom_final_callback": [True, False], - # Don"t decorate the used type erasure, which is done to keep type names minimal for better error messages in debug builds. "immediate_types": [True, False], } default_options = { @@ -37,44 +35,84 @@ class ContinuableConan(ConanFile): "custom_error_type": False, "unhandled_exceptions": False, "custom_final_callback": False, - "immediate_types": False + "immediate_types": False, + } + options_description = { + "no_exceptions": ( + "Exceptions are disabled and `std::error_condition` is used as error_type. " + "See tutorial-chaining-continuables-fail for details." + ), + "custom_error_type": ( + "Exceptions are disabled and the type defined by `CONTINUABLE_WITH_CUSTOM_ERROR_TYPE` " + "is used as error_type. See tutorial-chaining-continuables-fail for details." + ), + "unhandled_exceptions": ( + "Allows unhandled exceptions in asynchronous call hierarchies. " + "See tutorial-chaining-continuables-fail for details." + ), + "custom_final_callback": ( + "Allows to customize the final callback which can be used to implement custom unhandled" + " asynchronous exception handlers." + ), + "immediate_types": ( + "Don't decorate the used type erasure, " + "which is done to keep type names minimal for better error messages in debug builds." + ), } + no_copy_source = True @property - def _source_subfolder(self): - return "source_subfolder" + def _min_cppstd(self): + return 14 - def validate(self): - minimal_cpp_standard = "14" - if self.settings.compiler.cppstd: - tools.check_min_cppstd(self, minimal_cpp_standard) - minimal_version = { + @property + def _compilers_minimum_version(self): + return { "gcc": "5", "clang": "3.4", "apple-clang": "10", - "Visual Studio": "14" + "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)) + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("function2/4.1.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) + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) def source(self): - tools.get(**self.conan_data["sources"][self.version]) - extracted_dir = "continuable-" + 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.txt", dst="licenses", src=self._source_subfolder) - self.copy(pattern="*", dst=os.path.join("include", "continuable"), src=os.path.join(self._source_subfolder, "include", "continuable")) + copy( + self, + pattern="LICENSE.txt", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder, + ) + copy( + self, + pattern="*", + dst=os.path.join(self.package_folder, "include", "continuable"), + src=os.path.join(self.source_folder, "include", "continuable"), + ) def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + if self.settings.os == "Linux": self.cpp_info.system_libs.append("pthread") if self.options.no_exceptions: @@ -87,6 +125,3 @@ def package_info(self): self.cpp_info.defines.append("CONTINUABLE_WITH_CUSTOM_FINAL_CALLBACK") if self.options.immediate_types: self.cpp_info.defines.append("CONTINUABLE_WITH_IMMEDIATE_TYPES") - - def package_id(self): - self.info.header_only() diff --git a/recipes/continuable/all/test_package/CMakeLists.txt b/recipes/continuable/all/test_package/CMakeLists.txt index 7dd0ea22e1254..f98eae0c75bf8 100644 --- a/recipes/continuable/all/test_package/CMakeLists.txt +++ b/recipes/continuable/all/test_package/CMakeLists.txt @@ -1,14 +1,11 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(continuable REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -set_target_properties( - ${PROJECT_NAME} PROPERTIES - +set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 14 CXX_STANDARD_REQUIRED ON ) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE continuable::continuable) diff --git a/recipes/continuable/all/test_package/conanfile.py b/recipes/continuable/all/test_package/conanfile.py index bd7165a553cf4..ef5d7042163ec 100644 --- a/recipes/continuable/all/test_package/conanfile.py +++ b/recipes/continuable/all/test_package/conanfile.py @@ -1,10 +1,19 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self.settings): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/continuable/all/test_package/test_package.cpp b/recipes/continuable/all/test_package/test_package.cpp index b26567acd4b10..92cb7db2c14ee 100644 --- a/recipes/continuable/all/test_package/test_package.cpp +++ b/recipes/continuable/all/test_package/test_package.cpp @@ -2,7 +2,7 @@ #include "continuable/continuable.hpp" -int main(int, char**) { +int main() { cti::make_ready_continuable("..."); return 0; From 5e58e1f455f90f5fa9ce5d717eb11fef288236c8 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Wed, 28 Jun 2023 14:21:41 +0100 Subject: [PATCH 22/59] (#18091) certify: migrate to Conan v2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * certify: migrate to Conan v2 * Update recipes/certify/all/conanfile.py --------- Co-authored-by: Rubén Rincón Blanco --- recipes/certify/all/conanfile.py | 67 ++++++++++++------- .../certify/all/test_package/CMakeLists.txt | 7 +- recipes/certify/all/test_package/conanfile.py | 21 ++++-- .../certify/all/test_package/test_package.cpp | 18 ++--- 4 files changed, 68 insertions(+), 45 deletions(-) diff --git a/recipes/certify/all/conanfile.py b/recipes/certify/all/conanfile.py index 86be0e74f0cf1..c1cb170b0ac8c 100644 --- a/recipes/certify/all/conanfile.py +++ b/recipes/certify/all/conanfile.py @@ -1,23 +1,29 @@ -from conans import ConanFile, tools -from conans.errors import ConanInvalidConfiguration import os -required_conan_version = ">=1.43.0" +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout + +required_conan_version = ">=1.52.0" class CertifyConan(ConanFile): name = "certify" description = "Platform-specific TLS keystore abstraction for use with Boost.ASIO and OpenSSL" - topics = ("boost", "asio", "tls", "ssl", "https") + license = "BSL-1.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/djarek/certify" - license = "BSL-1.0" + topics = ("boost", "asio", "tls", "ssl", "https", "header-only") + + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True @property - def _source_subfolder(self): - return "source_subfolder" + def _min_cppstd(self): + return 17 @property def _compilers_minimum_version(self): @@ -28,17 +34,19 @@ def _compilers_minimum_version(self): "apple-clang": "11", } - @property - def _min_cppstd(self): - return "17" + def layout(self): + basic_layout(self, src_folder="src") def requirements(self): - self.requires("boost/1.79.0") - self.requires("openssl/1.1.1q") + self.requires("boost/1.82.0") + self.requires("openssl/[>=1.1 <4]") + + 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 lazy_lt_semver(v1, v2): lv1 = [int(v) for v in v1.split(".")] @@ -48,29 +56,38 @@ def lazy_lt_semver(v1, v2): minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) if not minimum_version: - self.output.warn("{} requires C++17. Your compiler is unknown. Assuming it supports C++17.".format(self.name)) + self.output.warning( + f"{self.name} 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("{} requires C++17, which your compiler does not support.".format(self.name)) - - def package_id(self): - self.info.header_only() + raise ConanInvalidConfiguration( + f"{self.name} requires C++17, which your compiler does not support." + ) 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_1_0.txt", dst="licenses", - src=self._source_subfolder) - self.copy(pattern="*", dst="include", - src=os.path.join(self._source_subfolder, "include")) + copy( + self, + pattern="LICENSE_1_0.txt", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder, + ) + copy( + self, + pattern="*", + 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", "certify") self.cpp_info.set_property("cmake_target_name", "certify::core") - self.cpp_info.components["_certify"].requires = ["boost::boost", "openssl::openssl"] + self.cpp_info.components["_certify"].requires = ["boost::boost", "openssl::openssl"] self.cpp_info.components["_certify"].names["cmake_find_package"] = "core" self.cpp_info.components["_certify"].names["cmake_find_package_multi"] = "core" + self.cpp_info.names["cmake_find_package"] = "certify" self.cpp_info.names["cmake_find_package_multi"] = "certify" diff --git a/recipes/certify/all/test_package/CMakeLists.txt b/recipes/certify/all/test_package/CMakeLists.txt index 37373018e655a..2d5f2ce7457e3 100644 --- a/recipes/certify/all/test_package/CMakeLists.txt +++ b/recipes/certify/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) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) find_package(certify REQUIRED CONFIG) diff --git a/recipes/certify/all/test_package/conanfile.py b/recipes/certify/all/test_package/conanfile.py index 49a3a66ea5bad..ef5d7042163ec 100644 --- a/recipes/certify/all/test_package/conanfile.py +++ b/recipes/certify/all/test_package/conanfile.py @@ -1,10 +1,19 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package_multi" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/certify/all/test_package/test_package.cpp b/recipes/certify/all/test_package/test_package.cpp index 28f4c97339bb8..6e95446160938 100644 --- a/recipes/certify/all/test_package/test_package.cpp +++ b/recipes/certify/all/test_package/test_package.cpp @@ -6,15 +6,15 @@ #include int main() { - boost::asio::io_context ioc{1}; - boost::asio::ssl::context context{boost::asio::ssl::context_base::method::tls_client}; - boost::asio::ssl::stream stream(ioc, context); - constexpr auto hostname = "example.com"; + boost::asio::io_context ioc{1}; + boost::asio::ssl::context context{boost::asio::ssl::context_base::method::tls_client}; + boost::asio::ssl::stream stream(ioc, context); + constexpr auto hostname = "example.com"; - BOOST_TEST(boost::certify::sni_hostname(stream).empty()); - boost::certify::sni_hostname(stream, hostname); - BOOST_TEST(boost::certify::sni_hostname(stream) == hostname); - std::cout << boost::report_errors(); + BOOST_TEST(boost::certify::sni_hostname(stream).empty()); + boost::certify::sni_hostname(stream, hostname); + BOOST_TEST(boost::certify::sni_hostname(stream) == hostname); + std::cout << boost::report_errors(); - return 0; + return 0; } From 305db1cf46d4294c0d399260ad3e28d25d84961d Mon Sep 17 00:00:00 2001 From: toge Date: Wed, 28 Jun 2023 22:42:13 +0900 Subject: [PATCH 23/59] (#18085) r8brain-free-src: add version 6.3, add package_type * r8brain-free-src: add version 6.3 * link math lib --- recipes/r8brain-free-src/all/conandata.yml | 3 +++ recipes/r8brain-free-src/all/conanfile.py | 3 ++- recipes/r8brain-free-src/config.yml | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/recipes/r8brain-free-src/all/conandata.yml b/recipes/r8brain-free-src/all/conandata.yml index 27ad749e21214..e43484f945f02 100644 --- a/recipes/r8brain-free-src/all/conandata.yml +++ b/recipes/r8brain-free-src/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "6.3": + url: "https://github.com/avaneev/r8brain-free-src/archive/refs/tags/version-6.3.tar.gz" + sha256: "f2cd46cd8806294d9be45ed4e6bda5f8ef1dc808625eec3facde784953d2bc23" "6.2": url: "https://github.com/avaneev/r8brain-free-src/archive/refs/tags/version-6.2.tar.gz" sha256: "5e576ec8cb6ae3969c4bcacb630ddc957fc20f60a6b08593681d16e06942597d" diff --git a/recipes/r8brain-free-src/all/conanfile.py b/recipes/r8brain-free-src/all/conanfile.py index c6a956008c5c7..50f5693f0f6cb 100644 --- a/recipes/r8brain-free-src/all/conanfile.py +++ b/recipes/r8brain-free-src/all/conanfile.py @@ -15,6 +15,7 @@ class R8brainFreeSrcConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/avaneev/r8brain-free-src" topics = ("audio", "sample-rate", "conversion", "audio-processing", "resampler") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -78,7 +79,7 @@ def package_info(self): self.cpp_info.libs = ["r8brain"] if self.settings.os in ["Linux", "FreeBSD"]: - self.cpp_info.system_libs.append("pthread") + self.cpp_info.system_libs.extend(["pthread", "m",]) if self.options.fft == "pffft": self.cpp_info.defines.append("R8B_PFFFT") diff --git a/recipes/r8brain-free-src/config.yml b/recipes/r8brain-free-src/config.yml index 541a5f21084de..8f56257b3441d 100644 --- a/recipes/r8brain-free-src/config.yml +++ b/recipes/r8brain-free-src/config.yml @@ -1,4 +1,6 @@ versions: + "6.3": + folder: all "6.2": folder: all "4.6": From e2bf4b4d63e5a4cac9a8e599986a4bd0afbc2942 Mon Sep 17 00:00:00 2001 From: toge Date: Wed, 28 Jun 2023 23:02:11 +0900 Subject: [PATCH 24/59] (#18083) rapidcsv: add version 8.77, add package_type --- recipes/rapidcsv/all/conandata.yml | 3 +++ recipes/rapidcsv/all/conanfile.py | 1 + recipes/rapidcsv/config.yml | 2 ++ 3 files changed, 6 insertions(+) diff --git a/recipes/rapidcsv/all/conandata.yml b/recipes/rapidcsv/all/conandata.yml index 502ec08fa730f..7a2083f7a43d3 100644 --- a/recipes/rapidcsv/all/conandata.yml +++ b/recipes/rapidcsv/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "8.77": + url: "https://github.com/d99kris/rapidcsv/archive/refs/tags/v8.77.tar.gz" + sha256: "2513c05e1a39799edd93787e86bdd83462bee06150b40942879af955288fa495" "8.75": url: "https://github.com/d99kris/rapidcsv/archive/refs/tags/v8.75.tar.gz" sha256: "004454890d371b4db370dfd44d64077f8f9b2b92e59d1d6471e1923f891485be" diff --git a/recipes/rapidcsv/all/conanfile.py b/recipes/rapidcsv/all/conanfile.py index a9d964b6536a3..758f7e3653563 100644 --- a/recipes/rapidcsv/all/conanfile.py +++ b/recipes/rapidcsv/all/conanfile.py @@ -13,6 +13,7 @@ class RapidcsvConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/d99kris/rapidcsv" topics = ("csv", "parser", "header-only") + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True diff --git a/recipes/rapidcsv/config.yml b/recipes/rapidcsv/config.yml index df34fa7350e3c..d18c0697363e9 100644 --- a/recipes/rapidcsv/config.yml +++ b/recipes/rapidcsv/config.yml @@ -1,4 +1,6 @@ versions: + "8.77": + folder: "all" "8.75": folder: "all" "8.69": From 8f0625f55152af939e95723f94711cc14bf39652 Mon Sep 17 00:00:00 2001 From: toge Date: Wed, 28 Jun 2023 23:41:58 +0900 Subject: [PATCH 25/59] (#18069) sfml: add version 2.6.0 * sfml: add version 2.6.0 * use minimp3 and glad in extlibs * copy license.md in 2.6.0 * disable WARNINGS_AS_ERRORS * disable warning flags on 2.6.0 * C++17 validation check for 2.6.0 * require C++11 not C++17 * use CoreServices framework on macOS --- recipes/sfml/all/conandata.yml | 26 +++++++-- recipes/sfml/all/conanfile.py | 20 ++++++- ...> 2.5.1-0001-cmake-robust-find-deps.patch} | 0 ...> 2.5.1-0002-allow-non-x86-64-macos.patch} | 0 ...patch => 2.5.1-0003-allow-shared-MT.patch} | 0 ...fix-ios.patch => 2.5.1-0004-fix-ios.patch} | 0 ...patch => 2.5.1-0005-remove-auto-ptr.patch} | 0 .../2.6.0-0001-cmake-robust-find-deps.patch | 57 +++++++++++++++++++ .../patches/2.6.0-0003-allow-shared-MT.patch | 13 +++++ .../sfml/all/patches/2.6.0-0004-fix-ios.patch | 28 +++++++++ .../2.6.0-0006-disable-warning-flags.patch | 22 +++++++ recipes/sfml/config.yml | 2 + 12 files changed, 160 insertions(+), 8 deletions(-) rename recipes/sfml/all/patches/{0001-cmake-robust-find-deps.patch => 2.5.1-0001-cmake-robust-find-deps.patch} (100%) rename recipes/sfml/all/patches/{0002-allow-non-x86-64-macos.patch => 2.5.1-0002-allow-non-x86-64-macos.patch} (100%) rename recipes/sfml/all/patches/{0003-allow-shared-MT.patch => 2.5.1-0003-allow-shared-MT.patch} (100%) rename recipes/sfml/all/patches/{0004-fix-ios.patch => 2.5.1-0004-fix-ios.patch} (100%) rename recipes/sfml/all/patches/{0005-remove-auto-ptr.patch => 2.5.1-0005-remove-auto-ptr.patch} (100%) create mode 100644 recipes/sfml/all/patches/2.6.0-0001-cmake-robust-find-deps.patch create mode 100644 recipes/sfml/all/patches/2.6.0-0003-allow-shared-MT.patch create mode 100644 recipes/sfml/all/patches/2.6.0-0004-fix-ios.patch create mode 100644 recipes/sfml/all/patches/2.6.0-0006-disable-warning-flags.patch diff --git a/recipes/sfml/all/conandata.yml b/recipes/sfml/all/conandata.yml index 58f8c7d9b6cc4..2d05c18fb61d8 100644 --- a/recipes/sfml/all/conandata.yml +++ b/recipes/sfml/all/conandata.yml @@ -1,22 +1,38 @@ sources: + "2.6.0": + url: "https://www.sfml-dev.org/files/SFML-2.6.0-sources.zip" + sha256: "dc477fc7266641709046bd38628c909f5748bd2564b388cf6c750a9e20cdfef1" "2.5.1": url: "https://www.sfml-dev.org/files/SFML-2.5.1-sources.zip" sha256: "bf1e0643acb92369b24572b703473af60bac82caf5af61e77c063b779471bb7f" patches: + "2.6.0": + - patch_file: "patches/2.6.0-0001-cmake-robust-find-deps.patch" + patch_description: "Robust discovery of dependencies" + patch_type: "conan" + - patch_file: "patches/2.6.0-0003-allow-shared-MT.patch" + patch_description: "Allow to build shared SFML with MT runtime" + patch_type: "portability" + - patch_file: "patches/2.6.0-0004-fix-ios.patch" + patch_description: "Fix iOS detection logic in CMakeLists" + patch_type: "portability" + - patch_file: "patches/2.6.0-0006-disable-warning-flags.patch" + patch_description: "Disable warning flags which may cause compilation errors" + patch_type: "portability" "2.5.1": - - patch_file: "patches/0001-cmake-robust-find-deps.patch" + - patch_file: "patches/2.5.1-0001-cmake-robust-find-deps.patch" patch_description: "Robust discovery of dependencies" patch_type: "conan" - - patch_file: "patches/0002-allow-non-x86-64-macos.patch" + - patch_file: "patches/2.5.1-0002-allow-non-x86-64-macos.patch" patch_description: "Allow compilation for macOS arm" patch_type: "portability" - - patch_file: "patches/0003-allow-shared-MT.patch" + - patch_file: "patches/2.5.1-0003-allow-shared-MT.patch" patch_description: "Allow to build shared SFML with MT runtime" patch_type: "portability" - - patch_file: "patches/0004-fix-ios.patch" + - patch_file: "patches/2.5.1-0004-fix-ios.patch" patch_description: "Fix iOS detection logic in CMakeLists" patch_type: "portability" - - patch_file: "patches/0005-remove-auto-ptr.patch" + - patch_file: "patches/2.5.1-0005-remove-auto-ptr.patch" patch_description: "Remove usage of auto_ptr to allow compilation with C++17 standard" patch_type: "portability" patch_source: "https://github.com/SFML/SFML/commit/bf92efe9a4035fee0258386173d53556aa196e49" diff --git a/recipes/sfml/all/conanfile.py b/recipes/sfml/all/conanfile.py index 18f3ab2ca1e58..71d6b68c2fa7e 100644 --- a/recipes/sfml/all/conanfile.py +++ b/recipes/sfml/all/conanfile.py @@ -2,8 +2,9 @@ from conan.errors import ConanInvalidConfiguration from conan.tools.apple import is_apple_os from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout -from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, rmdir, save +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, rmdir, save, copy from conan.tools.microsoft import is_msvc, is_msvc_static_runtime +from conan.tools.scm import Version import os import textwrap @@ -52,6 +53,7 @@ def layout(self): def requirements(self): if self.options.window: + # FIXME: use cci's glad if self.settings.os in ["Windows", "Linux", "FreeBSD", "Macos"]: self.requires("opengl/system") if self.settings.os == "Linux": @@ -61,6 +63,7 @@ def requirements(self): self.requires("freetype/2.13.0") self.requires("stb/cci.20220909") if self.options.audio: + # FIXME: use cci's minimp3 self.requires("flac/1.4.2") self.requires("openal-soft/1.22.2") self.requires("vorbis/1.3.7") @@ -73,7 +76,9 @@ def validate(self): def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) - rmdir(self, os.path.join(self.source_folder, "extlibs")) + # sfml/2.6.0 uses minimp3 and glad in extlibs + if Version(self.version) < "2.6.0": + rmdir(self, os.path.join(self.source_folder, "extlibs")) def generate(self): tc = CMakeToolchain(self) @@ -86,6 +91,9 @@ def generate(self): tc.variables["SFML_INSTALL_PKGCONFIG_FILES"] = False tc.variables["SFML_GENERATE_PDB"] = False tc.variables["SFML_USE_SYSTEM_DEPS"] = True + tc.variables["WARNINGS_AS_ERRORS"] = False + if Version(self.version) >= "2.6.0": + tc.variables["CMAKE_CXX_STANDARD"] = 11 if is_msvc(self): tc.variables["SFML_USE_STATIC_STD_LIBS"] = is_msvc_static_runtime(self) tc.generate() @@ -99,9 +107,12 @@ def build(self): cmake.build() def package(self): + if Version(self.version) >= "2.6.0": + copy(self, pattern="license.md", 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")) + rmdir(self, os.path.join(self.package_folder, "share")) # TODO: to remove in conan v2 once cmake_find_package* generators removed self._create_cmake_module_alias_targets( @@ -168,6 +179,9 @@ def carbon(): def iokit(): return ["IOKit"] if self.settings.os == "Macos" else [] + def coreservices(): + return ["CoreServices"] if self.settings.os == "Macos" else [] + def coregraphics(): return ["CoreGraphics"] if self.settings.os == "iOS" else [] @@ -220,7 +234,7 @@ def opengles_ios(): "system_libs": gdi32() + winmm() + usbhid() + android() + opengles_android(), "frameworks": foundation() + appkit() + iokit() + carbon() + uikit() + coregraphics() + quartzcore() + - coremotion() + opengles_ios(), + coreservices() + coremotion() + opengles_ios(), }, }) if self.options.graphics: diff --git a/recipes/sfml/all/patches/0001-cmake-robust-find-deps.patch b/recipes/sfml/all/patches/2.5.1-0001-cmake-robust-find-deps.patch similarity index 100% rename from recipes/sfml/all/patches/0001-cmake-robust-find-deps.patch rename to recipes/sfml/all/patches/2.5.1-0001-cmake-robust-find-deps.patch diff --git a/recipes/sfml/all/patches/0002-allow-non-x86-64-macos.patch b/recipes/sfml/all/patches/2.5.1-0002-allow-non-x86-64-macos.patch similarity index 100% rename from recipes/sfml/all/patches/0002-allow-non-x86-64-macos.patch rename to recipes/sfml/all/patches/2.5.1-0002-allow-non-x86-64-macos.patch diff --git a/recipes/sfml/all/patches/0003-allow-shared-MT.patch b/recipes/sfml/all/patches/2.5.1-0003-allow-shared-MT.patch similarity index 100% rename from recipes/sfml/all/patches/0003-allow-shared-MT.patch rename to recipes/sfml/all/patches/2.5.1-0003-allow-shared-MT.patch diff --git a/recipes/sfml/all/patches/0004-fix-ios.patch b/recipes/sfml/all/patches/2.5.1-0004-fix-ios.patch similarity index 100% rename from recipes/sfml/all/patches/0004-fix-ios.patch rename to recipes/sfml/all/patches/2.5.1-0004-fix-ios.patch diff --git a/recipes/sfml/all/patches/0005-remove-auto-ptr.patch b/recipes/sfml/all/patches/2.5.1-0005-remove-auto-ptr.patch similarity index 100% rename from recipes/sfml/all/patches/0005-remove-auto-ptr.patch rename to recipes/sfml/all/patches/2.5.1-0005-remove-auto-ptr.patch diff --git a/recipes/sfml/all/patches/2.6.0-0001-cmake-robust-find-deps.patch b/recipes/sfml/all/patches/2.6.0-0001-cmake-robust-find-deps.patch new file mode 100644 index 0000000000000..1e4a21511eb3b --- /dev/null +++ b/recipes/sfml/all/patches/2.6.0-0001-cmake-robust-find-deps.patch @@ -0,0 +1,57 @@ +diff --git a/src/SFML/Audio/CMakeLists.txt b/src/SFML/Audio/CMakeLists.txt +index d27dc6d..27c3386 100644 +--- a/src/SFML/Audio/CMakeLists.txt ++++ b/src/SFML/Audio/CMakeLists.txt +@@ -69,19 +69,17 @@ endif() + + # find external libraries + sfml_find_package(OpenAL INCLUDE "OPENAL_INCLUDE_DIR" LINK "OPENAL_LIBRARY") +-sfml_find_package(VORBIS INCLUDE "VORBIS_INCLUDE_DIRS" LINK "VORBIS_LIBRARIES") ++sfml_find_package(Vorbis INCLUDE "VORBIS_INCLUDE_DIRS" LINK "VORBIS_LIBRARIES") + sfml_find_package(FLAC INCLUDE "FLAC_INCLUDE_DIR" LINK "FLAC_LIBRARY") + + # avoids warnings in vorbisfile.h +-target_compile_definitions(VORBIS INTERFACE "OV_EXCLUDE_STATIC_CALLBACKS") +-target_compile_definitions(FLAC INTERFACE "FLAC__NO_DLL") + + # define the sfml-audio target + sfml_add_library(sfml-audio + SOURCES ${SRC} ${CODECS_SRC}) + + # setup dependencies +-target_link_libraries(sfml-audio PRIVATE OpenAL) ++target_link_libraries(sfml-audio PRIVATE OpenAL::OpenAL) + + # minimp3 sources + target_include_directories(sfml-audio SYSTEM PRIVATE "${PROJECT_SOURCE_DIR}/extlibs/headers/minimp3") +@@ -92,4 +90,4 @@ endif() + + target_link_libraries(sfml-audio + PUBLIC sfml-system +- PRIVATE VORBIS FLAC) ++ PRIVATE Vorbis::vorbisenc Vorbis::vorbisfile FLAC::FLAC) +diff --git a/src/SFML/Graphics/CMakeLists.txt b/src/SFML/Graphics/CMakeLists.txt +index a939a98..bd6a89b 100644 +--- a/src/SFML/Graphics/CMakeLists.txt ++++ b/src/SFML/Graphics/CMakeLists.txt +@@ -93,7 +93,8 @@ sfml_add_library(sfml-graphics + target_link_libraries(sfml-graphics PUBLIC sfml-window) + + # stb_image sources +-target_include_directories(sfml-graphics SYSTEM PRIVATE "${PROJECT_SOURCE_DIR}/extlibs/headers/stb_image") ++find_package(stb REQUIRED CONFIG) ++target_link_libraries(sfml-graphics PRIVATE stb::stb) + + # glad sources + target_include_directories(sfml-graphics SYSTEM PRIVATE "${PROJECT_SOURCE_DIR}/extlibs/headers/glad/include") +@@ -123,8 +124,8 @@ if((SFML_COMPILER_MSVC AND SFML_MSVC_VERSION GREATER_EQUAL 14) OR (SFML_COMPILER + target_link_libraries(sfml-graphics PRIVATE legacy_stdio_definitions.lib) + endif() + +-sfml_find_package(Freetype INCLUDE "FREETYPE_INCLUDE_DIRS" LINK "FREETYPE_LIBRARY") +-target_link_libraries(sfml-graphics PRIVATE Freetype) ++find_package(freetype REQUIRED) ++target_link_libraries(sfml-graphics PRIVATE freetype) + + # add preprocessor symbols + target_compile_definitions(sfml-graphics PRIVATE "STBI_FAILURE_USERMSG") diff --git a/recipes/sfml/all/patches/2.6.0-0003-allow-shared-MT.patch b/recipes/sfml/all/patches/2.6.0-0003-allow-shared-MT.patch new file mode 100644 index 0000000000000..59b4bbd230de7 --- /dev/null +++ b/recipes/sfml/all/patches/2.6.0-0003-allow-shared-MT.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 9e3f89d..003857e 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -223,7 +223,7 @@ if(SFML_OS_WINDOWS) + sfml_set_option(SFML_USE_STATIC_STD_LIBS FALSE BOOL "TRUE to statically link to the standard libraries, FALSE to use them as DLLs") + + # the following combination of flags is not valid +- if(BUILD_SHARED_LIBS AND SFML_USE_STATIC_STD_LIBS) ++ if(0) + message(FATAL_ERROR "BUILD_SHARED_LIBS and SFML_USE_STATIC_STD_LIBS cannot be used together") + endif() + diff --git a/recipes/sfml/all/patches/2.6.0-0004-fix-ios.patch b/recipes/sfml/all/patches/2.6.0-0004-fix-ios.patch new file mode 100644 index 0000000000000..34b49a186218d --- /dev/null +++ b/recipes/sfml/all/patches/2.6.0-0004-fix-ios.patch @@ -0,0 +1,28 @@ +diff --git a/cmake/Config.cmake b/cmake/Config.cmake +index 2ce5ac4..3cd3a07 100644 +--- a/cmake/Config.cmake ++++ b/cmake/Config.cmake +@@ -39,13 +39,12 @@ elseif(CMAKE_SYSTEM_NAME MATCHES "^NetBSD$") + set(SFML_OS_NETBSD 1) + # don't use the OpenGL ES implementation on NetBSD + set(OPENGL_ES 0) +-elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") +- if(IOS) ++elseif(${CMAKE_SYSTEM_NAME} STREQUAL "iOS") + set(SFML_OS_IOS 1) + + # use the OpenGL ES implementation on iOS + set(OPENGL_ES 1) +- else() ++elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") + set(SFML_OS_MACOSX 1) + + # don't use the OpenGL ES implementation on Mac OS X +@@ -58,7 +57,6 @@ elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") + message(FATAL_ERROR "Unsupported version of OS X: ${MACOSX_VERSION_RAW}") + return() + endif() +- endif() + elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Android") + set(SFML_OS_ANDROID 1) + diff --git a/recipes/sfml/all/patches/2.6.0-0006-disable-warning-flags.patch b/recipes/sfml/all/patches/2.6.0-0006-disable-warning-flags.patch new file mode 100644 index 0000000000000..362c57e93365a --- /dev/null +++ b/recipes/sfml/all/patches/2.6.0-0006-disable-warning-flags.patch @@ -0,0 +1,22 @@ +diff --git a/cmake/Macros.cmake b/cmake/Macros.cmake +index e0118eb..85a7714 100644 +--- a/cmake/Macros.cmake ++++ b/cmake/Macros.cmake +@@ -66,8 +66,6 @@ macro(sfml_add_library target) + add_library(${target} ${THIS_SOURCES}) + endif() + +- set_file_warnings(${THIS_SOURCES}) +- + # define the export symbol of the module + string(REPLACE "-" "_" NAME_UPPER "${target}") + string(TOUPPER "${NAME_UPPER}" NAME_UPPER) +@@ -265,8 +263,6 @@ macro(sfml_add_example target) + add_executable(${target} ${target_input}) + endif() + +- set_file_warnings(${target_input}) +- + # set the debug suffix + set_target_properties(${target} PROPERTIES DEBUG_POSTFIX -d) + diff --git a/recipes/sfml/config.yml b/recipes/sfml/config.yml index eab83a303df52..a8b7c0e911e63 100644 --- a/recipes/sfml/config.yml +++ b/recipes/sfml/config.yml @@ -1,3 +1,5 @@ versions: + "2.6.0": + folder: all "2.5.1": folder: all From 180aef37e79e790708a96133c33d374eaf7a8f93 Mon Sep 17 00:00:00 2001 From: Matthieu Darbois Date: Wed, 28 Jun 2023 17:02:39 +0200 Subject: [PATCH 26/59] (#18047) libpng: add 1.6.40 version * libpng: add 1.6.40 version * rework renaming windows static library * Revert "rework renaming windows static library" This reverts commit ea0a535260e89d5c2e0d4d25f653a8b7a564123d. * use upstream library name for Windows static library * libpng: minor fixes * libpng: fix conditional --------- Co-authored-by: Luis Caro Campos <3535649+jcar87@users.noreply.github.com> --- recipes/libpng/all/conandata.yml | 3 +++ recipes/libpng/all/conanfile.py | 22 ++++++++++------------ recipes/libpng/config.yml | 2 ++ 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/recipes/libpng/all/conandata.yml b/recipes/libpng/all/conandata.yml index e10462996e48c..040df395bad79 100644 --- a/recipes/libpng/all/conandata.yml +++ b/recipes/libpng/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.6.40": + url: "https://sourceforge.net/projects/libpng/files/libpng16/1.6.40/libpng-1.6.40.tar.xz" + sha256: "535b479b2467ff231a3ec6d92a525906fb8ef27978be4f66dbe05d3f3a01b3a1" "1.6.39": url: "https://sourceforge.net/projects/libpng/files/libpng16/1.6.39/libpng-1.6.39.tar.xz" sha256: "1f4696ce70b4ee5f85f1e1623dc1229b210029fa4b7aee573df3e2ba7b036937" diff --git a/recipes/libpng/all/conanfile.py b/recipes/libpng/all/conanfile.py index 5b838438efa3b..a67c210911f86 100644 --- a/recipes/libpng/all/conanfile.py +++ b/recipes/libpng/all/conanfile.py @@ -126,25 +126,21 @@ def generate(self): def _patch_sources(self): apply_conandata_patches(self) if self.settings.os == "Windows": - if Version(self.version) <= "1.5.2": - replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), - 'set(PNG_LIB_NAME_STATIC ${PNG_LIB_NAME}_static)', - 'set(PNG_LIB_NAME_STATIC ${PNG_LIB_NAME})') - else: - replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), - 'OUTPUT_NAME "${PNG_LIB_NAME}_static', - 'OUTPUT_NAME "${PNG_LIB_NAME}') if not (is_msvc(self) or self._is_clang_cl): if Version(self.version) < "1.6.38": src_text = 'COMMAND "${CMAKE_COMMAND}" -E copy_if_different $ $/${DEST_FILE}' - else: + elif Version(self.version) == "1.6.39": src_text = '''COMMAND "${CMAKE_COMMAND}" -E copy_if_different $ $/${DEST_FILE}''' - replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), - src_text, - 'COMMAND "${CMAKE_COMMAND}" -E copy_if_different $/$ $/${DEST_FILE}') + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + src_text, + 'COMMAND "${CMAKE_COMMAND}" -E copy_if_different $/$ $/${DEST_FILE}') + else: + # TODO: evaluate and document in what issue this patch aims to resolve, and in which scenarios it is needed + # Note: the cmake logic for this has changed again in versions >=1.6.40 + pass def build(self): self._patch_sources() @@ -175,6 +171,8 @@ def package_info(self): prefix = "lib" if (is_msvc(self) or self._is_clang_cl) else "" suffix = major_min_version if self.settings.os == "Windows" else "" + if is_msvc(self) or self._is_clang_cl: + suffix += "_static" if not self.options.shared else "" suffix += "d" if self.settings.os == "Windows" and self.settings.build_type == "Debug" else "" self.cpp_info.libs = [f"{prefix}png{suffix}"] if self.settings.os in ["Linux", "Android", "FreeBSD", "SunOS", "AIX"]: diff --git a/recipes/libpng/config.yml b/recipes/libpng/config.yml index feabbd00c1919..c56aca473ff02 100644 --- a/recipes/libpng/config.yml +++ b/recipes/libpng/config.yml @@ -1,4 +1,6 @@ versions: + "1.6.40": + folder: all "1.6.39": folder: all "1.6.38": From bffdf8e6d65f820f561a6b42763601f05dc10a0c Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Wed, 28 Jun 2023 16:42:56 +0100 Subject: [PATCH 27/59] (#17994) sbp: add Conan v2 support, add v4.15.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * sbp: add Conan v2 support * sbp: add v4.15.0 * spb: disable tests and docs --------- Co-authored-by: Rubén Rincón Blanco --- recipes/sbp/all/CMakeLists.txt | 7 -- recipes/sbp/all/conandata.yml | 17 +++-- recipes/sbp/all/conanfile.py | 82 +++++++++++---------- recipes/sbp/all/test_package/CMakeLists.txt | 7 +- recipes/sbp/all/test_package/conanfile.py | 19 +++-- recipes/sbp/config.yml | 4 +- 6 files changed, 76 insertions(+), 60 deletions(-) delete mode 100644 recipes/sbp/all/CMakeLists.txt diff --git a/recipes/sbp/all/CMakeLists.txt b/recipes/sbp/all/CMakeLists.txt deleted file mode 100644 index 454b398b885e5..0000000000000 --- a/recipes/sbp/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/c") diff --git a/recipes/sbp/all/conandata.yml b/recipes/sbp/all/conandata.yml index f640026c27acb..c5be56f8c3b1f 100644 --- a/recipes/sbp/all/conandata.yml +++ b/recipes/sbp/all/conandata.yml @@ -1,11 +1,11 @@ sources: - "3.4.10": + "4.15.0": cmake: - url: "https://github.com/swift-nav/cmake/archive/373d4fcafbbc0c208dc9ecb278d36ed8c9448eda.zip" - sha256: 6077d2a754d013e3cb9826f589e47b19ab01f4d91ede4f5bfc14db74bc5dc894 + url: "https://github.com/swift-nav/cmake/archive/12b7f037e7cc721a9a36c7342ba2ca2b0cafc01e.zip" + sha256: 6a725914bf8c3ed13065812cf4d7b0a69e478eaa150561e0e3be4cd01bf3798f source: - url: "https://github.com/swift-nav/libsbp/archive/refs/tags/v3.4.10.tar.gz" - sha256: f2fb738f49112b25e7849ca0c75415159127e9b5373b13e7027362b8fa0b1224 + url: "https://github.com/swift-nav/libsbp/archive/refs/tags/v4.15.0.tar.gz" + sha256: e71fd7dd5536058d6b93ade443913e68da7b4f1896aa720dc369baab1864e9e9 "4.2.0": cmake: url: "https://github.com/swift-nav/cmake/archive/31604e72e72c09fa32effdbc37acc79dda7c99d7.zip" @@ -13,3 +13,10 @@ sources: source: url: "https://github.com/swift-nav/libsbp/archive/refs/tags/v4.2.0.tar.gz" sha256: 9ee9808394867405938505fb0aa52ffeb8d98b7ce222e47629ffabdc9e23d3e4 + "3.4.10": + cmake: + url: "https://github.com/swift-nav/cmake/archive/373d4fcafbbc0c208dc9ecb278d36ed8c9448eda.zip" + sha256: 6077d2a754d013e3cb9826f589e47b19ab01f4d91ede4f5bfc14db74bc5dc894 + source: + url: "https://github.com/swift-nav/libsbp/archive/refs/tags/v3.4.10.tar.gz" + sha256: f2fb738f49112b25e7849ca0c75415159127e9b5373b13e7027362b8fa0b1224 diff --git a/recipes/sbp/all/conanfile.py b/recipes/sbp/all/conanfile.py index 77edf2fd79a3e..b94c371fc9b5b 100644 --- a/recipes/sbp/all/conanfile.py +++ b/recipes/sbp/all/conanfile.py @@ -1,27 +1,30 @@ import os -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import get, copy + +required_conan_version = ">=1.53.0" class SbpConan(ConanFile): name = "sbp" + description = "Swift Binary Protocol client library" license = "MIT" - homepage = "https://github.com/swift-nav/libsbp" url = "https://github.com/conan-io/conan-center-index" - description = "Swift Binary Protocol client library" + homepage = "https://github.com/swift-nav/libsbp" topics = ("gnss",) - 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", "c" - - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } def config_options(self): if self.settings.os == "Windows": @@ -29,41 +32,46 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") def validate(self): if self.settings.os == "Windows" and self.options.shared: - raise ConanInvalidConfiguration("Windows shared builds are not supported right now, see issue https://github.com/swift-nav/libsbp/issues/1062") + raise ConanInvalidConfiguration( + "Windows shared builds are not supported right now, " + "see issue https://github.com/swift-nav/libsbp/issues/1062" + ) + + def layout(self): + cmake_layout(self, src_folder="src") def source(self): data = self.conan_data["sources"][self.version] + get(self, **data["source"], strip_root=True) + get(self, **data["cmake"], strip_root=True, destination=os.path.join("c", "cmake", "common")) - tools.get(**data["source"], strip_root=True, destination=self._source_subfolder) - tools.get(**data["cmake"], strip_root=True, destination=os.path.join(self._source_subfolder, "c", "cmake", "common")) - - def _configure_cmake(self): - if self._cmake: - return self._cmake - - self._cmake = CMake(self) - self._cmake.definitions["libsbp_ENABLE_TESTS"] = False - self._cmake.definitions["libsbp_ENABLE_DOCS"] = False - self._cmake.configure() - return self._cmake + def generate(self): + tc = CMakeToolchain(self) + tc.variables["libsbp_ENABLE_TESTS"] = False + tc.variables["libsbp_ENABLE_DOCS"] = False + tc.generate() + tc = CMakeDeps(self) + tc.generate() def build(self): - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure(build_script_folder="c") cmake.build() def package(self): - self.copy( - "LICENSE", - src=self._source_subfolder, - dst="licenses", - ignore_case=True, - keep_path=False, + copy( + self, + pattern="LICENSE", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder, ) - cmake = self._configure_cmake() + cmake = CMake(self) cmake.install() def package_info(self): diff --git a/recipes/sbp/all/test_package/CMakeLists.txt b/recipes/sbp/all/test_package/CMakeLists.txt index d9693fa5cada2..6da47266b9454 100644 --- a/recipes/sbp/all/test_package/CMakeLists.txt +++ b/recipes/sbp/all/test_package/CMakeLists.txt @@ -1,8 +1,5 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package C) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) find_package(sbp REQUIRED CONFIG) diff --git a/recipes/sbp/all/test_package/conanfile.py b/recipes/sbp/all/test_package/conanfile.py index 38f4483872d47..ef5d7042163ec 100644 --- a/recipes/sbp/all/test_package/conanfile.py +++ b/recipes/sbp/all/test_package/conanfile.py @@ -1,10 +1,19 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/sbp/config.yml b/recipes/sbp/config.yml index 84cd65924d4fb..6e299a70ad6f8 100644 --- a/recipes/sbp/config.yml +++ b/recipes/sbp/config.yml @@ -1,5 +1,7 @@ versions: - "3.4.10": + "4.15.0": folder: "all" "4.2.0": folder: "all" + "3.4.10": + folder: "all" From ca817740b568d381896dc56e1c5faa0653a9bffd Mon Sep 17 00:00:00 2001 From: "C.D. Clark III" Date: Wed, 28 Jun 2023 11:22:22 -0500 Subject: [PATCH 28/59] (#18014) [libinterpolate]: added version 2.6.4, which adds Windows support. * [libinterpolate]: added version 2.6.4, which adds Windows support. * [libinterpolate]: fixed conandata.yml linter errors * Update recipes/libinterpolate/all/conanfile.py fix: limit <2.6.4 versions to Linux only Co-authored-by: Uilian Ries --------- Co-authored-by: Uilian Ries --- recipes/libinterpolate/all/conandata.yml | 4 ++++ recipes/libinterpolate/all/conanfile.py | 7 ++++--- recipes/libinterpolate/config.yml | 2 ++ 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/recipes/libinterpolate/all/conandata.yml b/recipes/libinterpolate/all/conandata.yml index ccfe0443cddf0..7d38fb0462c3a 100644 --- a/recipes/libinterpolate/all/conandata.yml +++ b/recipes/libinterpolate/all/conandata.yml @@ -7,3 +7,7 @@ sources: url: - "https://github.com/CD3/libInterpolate/archive/refs/tags/2.6.3.tar.gz" sha256: "bb2f253c27594b4e56ed9349630086665f529100eac2cd3cba63d198c3a84ff9" + "2.6.4": + url: + - "https://github.com/CD3/libInterpolate/archive/refs/tags/2.6.4.tar.gz" + sha256: "231a39fcc87ffc3e03936f7a21abc78ef309c2f1de79bd3ae72c24d78352d666" diff --git a/recipes/libinterpolate/all/conanfile.py b/recipes/libinterpolate/all/conanfile.py index 62e7baa6e4ea4..b1c88daae5803 100644 --- a/recipes/libinterpolate/all/conanfile.py +++ b/recipes/libinterpolate/all/conanfile.py @@ -43,9 +43,10 @@ def requirements(self): self.requires("eigen/3.3.7", transitive_headers=True) def validate(self): - if self.settings.os != "Linux": - raise ConanInvalidConfiguration("libInterpolate currently only supports Linux. Upstream PR's are welcome (https://github.com/CD3/libInterpolate/issues/14).") - + if Version(self.version) < "2.6.4" and self.settings.os != "Linux": + raise ConanInvalidConfiguration(f"{self.ref} is not supported by {self.settings.os}; Try the version >= 2.6.4") + if Version(self.version) >= "2.6.4" and self.settings.os not in ["Linux", "Windows"]: + raise ConanInvalidConfiguration(f"{self.ref} is not supported by {self.settings.os}.") if self.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, self._min_cppstd) minimum_version = self._compilers_minimum_version.get( diff --git a/recipes/libinterpolate/config.yml b/recipes/libinterpolate/config.yml index f4cf1cbc64d28..2f31497672d43 100644 --- a/recipes/libinterpolate/config.yml +++ b/recipes/libinterpolate/config.yml @@ -3,3 +3,5 @@ versions: folder: all "2.6.3": folder: all + "2.6.4": + folder: all From d51d126913980b544bbbadaf6f64adf6827669a1 Mon Sep 17 00:00:00 2001 From: qwqbot Date: Thu, 29 Jun 2023 00:44:43 +0800 Subject: [PATCH 29/59] (#17976) spdlog: bump fmt10.0.0 and apply patch to fix build error --- recipes/spdlog/all/conandata.yml | 6 ++++ recipes/spdlog/all/conanfile.py | 8 +++-- .../patches/1.11.0-0001-fix-fmt10-build.patch | 34 +++++++++++++++++++ 3 files changed, 46 insertions(+), 2 deletions(-) create mode 100644 recipes/spdlog/all/patches/1.11.0-0001-fix-fmt10-build.patch diff --git a/recipes/spdlog/all/conandata.yml b/recipes/spdlog/all/conandata.yml index ca7a629380047..d6609a68f5915 100644 --- a/recipes/spdlog/all/conandata.yml +++ b/recipes/spdlog/all/conandata.yml @@ -14,3 +14,9 @@ sources: "1.8.5": url: "https://github.com/gabime/spdlog/archive/v1.8.5.tar.gz" sha256: "944d0bd7c763ac721398dca2bb0f3b5ed16f67cef36810ede5061f35a543b4b8" +patches: + "1.11.0": + - patch_file: "patches/1.11.0-0001-fix-fmt10-build.patch" + patch_description: "Fix fmt 10.0.0 build" + patch_type: "conan" + patch_source: "https://github.com/gabime/spdlog/pull/2694" diff --git a/recipes/spdlog/all/conanfile.py b/recipes/spdlog/all/conanfile.py index 7c21d2c9559c3..f2653d49db073 100644 --- a/recipes/spdlog/all/conanfile.py +++ b/recipes/spdlog/all/conanfile.py @@ -2,7 +2,7 @@ from conan.errors import ConanInvalidConfiguration from conan.tools.build import check_min_cppstd from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout -from conan.tools.files import get, copy, rmdir, replace_in_file +from conan.tools.files import get, copy, rmdir, replace_in_file, apply_conandata_patches, export_conandata_patches from conan.tools.microsoft import is_msvc_static_runtime from conan.tools.scm import Version import os @@ -36,6 +36,9 @@ class SpdlogConan(ConanFile): "no_exceptions": False, } + def export_sources(self): + export_conandata_patches(self) + def config_options(self): if self.settings.os == "Windows": del self.options.fPIC @@ -54,7 +57,7 @@ def requirements(self): fmt_version = "7.1.3" if self_version >= "1.11.0": - fmt_version = "9.1.0" + fmt_version = "10.0.0" elif self_version >= "1.10.0": fmt_version = "8.1.1" elif self_version >= "1.9.0": @@ -106,6 +109,7 @@ def _disable_werror(self): replace_in_file(self, os.path.join(self.source_folder, "cmake", "utils.cmake"), "/WX", "") def build(self): + apply_conandata_patches(self) self._disable_werror() if not self.options.header_only: cmake = CMake(self) diff --git a/recipes/spdlog/all/patches/1.11.0-0001-fix-fmt10-build.patch b/recipes/spdlog/all/patches/1.11.0-0001-fix-fmt10-build.patch new file mode 100644 index 0000000000000..613990e4eb052 --- /dev/null +++ b/recipes/spdlog/all/patches/1.11.0-0001-fix-fmt10-build.patch @@ -0,0 +1,34 @@ +From 576210a1363822a132657090b9f37e305bd0e2c2 Mon Sep 17 00:00:00 2001 +From: pwqbot +Date: Tue, 20 Jun 2023 10:41:48 +0800 +Subject: [PATCH] fix fmt build + +--- + include/spdlog/common.h | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +diff --git a/include/spdlog/common.h b/include/spdlog/common.h +index f97fd48c..00f4d728 100644 +--- a/include/spdlog/common.h ++++ b/include/spdlog/common.h +@@ -160,12 +160,19 @@ using format_string_t = fmt::format_string; + template + using remove_cvref_t = typename std::remove_cv::type>::type; + ++template ++# if FMT_VERSION >= 90101 ++using fmt_runtime_string = fmt::runtime_format_string; ++# else ++using fmt_runtime_string = fmt::basic_runtime; ++# endif ++ + // clang doesn't like SFINAE disabled constructor in std::is_convertible<> so have to repeat the condition from basic_format_string here, + // in addition, fmt::basic_runtime is only convertible to basic_format_string but not basic_string_view + template + struct is_convertible_to_basic_format_string + : std::integral_constant>::value || std::is_same, fmt::basic_runtime>::value> ++ std::is_convertible>::value || std::is_same, fmt_runtime_string>::value> + {}; + + # if defined(SPDLOG_WCHAR_FILENAMES) || defined(SPDLOG_WCHAR_TO_UTF8_SUPPORT) From cb9975bfdea716b0024aa1bae0ec07a1bb03227a Mon Sep 17 00:00:00 2001 From: Gregor Jasny Date: Wed, 28 Jun 2023 19:24:00 +0200 Subject: [PATCH 30/59] (#17725) protobuf: add version 3.21.12 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Rubén Rincón Blanco --- recipes/protobuf/all/conandata.yml | 8 ++++++ ...otobuf-3.21.12-upstream-macos-macros.patch | 25 +++++++++++++++++++ recipes/protobuf/config.yml | 2 ++ 3 files changed, 35 insertions(+) create mode 100644 recipes/protobuf/all/patches/protobuf-3.21.12-upstream-macos-macros.patch diff --git a/recipes/protobuf/all/conandata.yml b/recipes/protobuf/all/conandata.yml index 502de4a7d6777..76af562b2e6c0 100644 --- a/recipes/protobuf/all/conandata.yml +++ b/recipes/protobuf/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.21.12": + url: "https://github.com/protocolbuffers/protobuf/archive/refs/tags/v3.21.12.tar.gz" + sha256: "930c2c3b5ecc6c9c12615cf5ad93f1cd6e12d0aba862b572e076259970ac3a53" "3.21.9": url: "https://github.com/protocolbuffers/protobuf/archive/refs/tags/v3.21.9.tar.gz" sha256: "1add10f9bd92775b91f326da259f243881e904dd509367d5031d4c782ba82810" @@ -21,6 +24,11 @@ sources: url: "https://github.com/protocolbuffers/protobuf/archive/refs/tags/v3.17.1.tar.gz" sha256: "036d66d6eec216160dd898cfb162e9d82c1904627642667cc32b104d407bb411" patches: + "3.21.12": + - patch_file: "patches/protobuf-3.21.12-upstream-macos-macros.patch" + patch_description: "Handle case where macOS SDK macros may conflict with protobuf message types" + patch_type: "bugfix" + patch_source: "https://github.com/protocolbuffers/protobuf/pull/10103" "3.21.9": - patch_file: "patches/protobuf-3.21.9-upstream-macos-macros.patch" patch_description: "Handle case where macOS SDK macros may conflict with protobuf message types" diff --git a/recipes/protobuf/all/patches/protobuf-3.21.12-upstream-macos-macros.patch b/recipes/protobuf/all/patches/protobuf-3.21.12-upstream-macos-macros.patch new file mode 100644 index 0000000000000..3a152f62bca69 --- /dev/null +++ b/recipes/protobuf/all/patches/protobuf-3.21.12-upstream-macos-macros.patch @@ -0,0 +1,25 @@ +diff --git a/src/google/protobuf/port_def.inc b/src/google/protobuf/port_def.inc +index f00daf7..d956db2 100644 +--- a/src/google/protobuf/port_def.inc ++++ b/src/google/protobuf/port_def.inc +@@ -870,6 +870,8 @@ + // Inconvenient macro names from usr/include/sys/syslimits.h in some macOS SDKs. + #pragma push_macro("UID_MAX") + #undef UID_MAX ++#pragma push_macro("GID_MAX") ++#undef GID_MAX + #endif // __APPLE__ + + #if defined(__clang__) || PROTOBUF_GNUC_MIN(3, 0) || defined(_MSC_VER) +diff --git a/src/google/protobuf/port_undef.inc b/src/google/protobuf/port_undef.inc +index e880fa5..f8968d9 100644 +--- a/src/google/protobuf/port_undef.inc ++++ b/src/google/protobuf/port_undef.inc +@@ -144,6 +144,7 @@ + #pragma pop_macro("TRUE") + #pragma pop_macro("FALSE") + #pragma pop_macro("UID_MAX") ++#pragma pop_macro("GID_MAX") + #endif // __APPLE__ + + #if defined(__clang__) || defined(__GNUC__) || defined(_MSC_VER) diff --git a/recipes/protobuf/config.yml b/recipes/protobuf/config.yml index c22211a7a9d4e..1c42531d91fe0 100644 --- a/recipes/protobuf/config.yml +++ b/recipes/protobuf/config.yml @@ -1,4 +1,6 @@ versions: + "3.21.12": + folder: all "3.21.9": folder: all "3.21.4": From 995273570b85107aedf4dc56d78eec83519f9bd2 Mon Sep 17 00:00:00 2001 From: toge Date: Thu, 29 Jun 2023 03:03:46 +0900 Subject: [PATCH 31/59] (#17147) jsonnet: add version 0.20.0, support conan v2 * jsonnet: add version 0.20.0, support conan v2 * add patch_description * fix typo * use C++17 in 0.20.0 * fix typo * remove duplicated validate * disable force C++17 patch for 0.20.0 and 0.17.0 (from review comments) * force C++17 on 0.20.0 * Update recipes/jsonnet/all/patches/0.20.0/0003-use-cpp17.patch * fix patch --------- Co-authored-by: James Co-authored-by: James --- recipes/jsonnet/all/CMakeLists.txt | 9 -- recipes/jsonnet/all/conandata.yml | 32 ++++- recipes/jsonnet/all/conanfile.py | 130 ++++++++++-------- .../all/patches/0.17.0/0002-cmake-fixes.patch | 77 ++++++----- .../all/patches/0.18.0/0002-cmake-fixes.patch | 20 ++- .../all/patches/0.20.0/0003-use-cpp17.patch | 14 ++ .../jsonnet/all/test_package/CMakeLists.txt | 17 +-- recipes/jsonnet/all/test_package/conanfile.py | 22 ++- .../all/test_v1_package/CMakeLists.txt | 8 ++ .../jsonnet/all/test_v1_package/conanfile.py | 18 +++ recipes/jsonnet/config.yml | 2 + 11 files changed, 227 insertions(+), 122 deletions(-) delete mode 100644 recipes/jsonnet/all/CMakeLists.txt create mode 100644 recipes/jsonnet/all/patches/0.20.0/0003-use-cpp17.patch create mode 100644 recipes/jsonnet/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/jsonnet/all/test_v1_package/conanfile.py diff --git a/recipes/jsonnet/all/CMakeLists.txt b/recipes/jsonnet/all/CMakeLists.txt deleted file mode 100644 index 881b1cb39250b..0000000000000 --- a/recipes/jsonnet/all/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -cmake_minimum_required(VERSION 3.4) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup() - -set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) - -add_subdirectory(source_subfolder) diff --git a/recipes/jsonnet/all/conandata.yml b/recipes/jsonnet/all/conandata.yml index af6fab5053143..260d7031fb23c 100644 --- a/recipes/jsonnet/all/conandata.yml +++ b/recipes/jsonnet/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.20.0": + url: "https://github.com/google/jsonnet/archive/v0.20.0.tar.gz" + sha256: "77bd269073807731f6b11ff8d7c03e9065aafb8e4d038935deb388325e52511b" "0.19.1": url: "https://github.com/google/jsonnet/archive/v0.19.1.tar.gz" sha256: "f5a20f2dc98fdebd5d42a45365f52fa59a7e6b174e43970fea4f9718a914e887" @@ -9,18 +12,35 @@ sources: url: "https://github.com/google/jsonnet/archive/v0.17.0.tar.gz" sha256: "076b52edf888c01097010ad4299e3b2e7a72b60a41abbc65af364af1ed3c8dbe" patches: + "0.20.0": + - patch_file: "patches/0.18.0/0001-fix-nlohmann-include.patch" + patch_description: "fix include path to use cci package" + patch_type: "conan" + - patch_file: "patches/0.18.0/0002-cmake-fixes.patch" + patch_description: "fix rapidyaml name, add installation" + patch_type: "conan" + - patch_file: "patches/0.20.0/0003-use-cpp17.patch" + patch_description: "use C++17" + patch_type: "portability" + patch_source: "https://github.com/google/jsonnet/pull/1076" "0.19.1": - patch_file: "patches/0.18.0/0001-fix-nlohmann-include.patch" - base_path: "source_subfolder" + patch_description: "fix include path to use cci package" + patch_type: "conan" - patch_file: "patches/0.18.0/0002-cmake-fixes.patch" - base_path: "source_subfolder" + patch_description: "fix rapidyaml name, add installation" + patch_type: "conan" "0.18.0": - patch_file: "patches/0.18.0/0001-fix-nlohmann-include.patch" - base_path: "source_subfolder" + patch_description: "fix include path to use cci package" + patch_type: "conan" - patch_file: "patches/0.18.0/0002-cmake-fixes.patch" - base_path: "source_subfolder" + patch_description: "fix rapidyaml name, add installation" + patch_type: "conan" "0.17.0": - patch_file: "patches/0.17.0/0001-fix-nlohmann-include.patch" - base_path: "source_subfolder" + patch_description: "fix include path to use cci package" + patch_type: "conan" - patch_file: "patches/0.17.0/0002-cmake-fixes.patch" - base_path: "source_subfolder" + patch_description: "fix rapidyaml name, add installation" + patch_type: "conan" diff --git a/recipes/jsonnet/all/conanfile.py b/recipes/jsonnet/all/conanfile.py index ff9c2346a3e5f..0581568a5b5ce 100644 --- a/recipes/jsonnet/all/conanfile.py +++ b/recipes/jsonnet/all/conanfile.py @@ -1,19 +1,23 @@ -import functools -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration from conan.tools.microsoft import is_msvc, msvc_runtime_flag +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy +from conan.tools.build import check_min_cppstd, cross_building, stdcpp_library +from conan.tools.scm import Version +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +import os -required_conan_version = ">=1.33.0" - +required_conan_version = ">=1.53.0" class JsonnetConan(ConanFile): name = "jsonnet" description = "Jsonnet - The data templating language" - topics = ("config", "json", "functional", "configuration") license = "Apache-2.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/google/jsonnet" + topics = ("config", "json", "functional", "configuration") settings = "os", "arch", "compiler", "build_type" + package_type = "library" options = { "shared": [True, False], "fPIC": [True, False], @@ -22,15 +26,25 @@ class JsonnetConan(ConanFile): "shared": False, "fPIC": True, } - generators = "cmake", "cmake_find_package" @property - def _source_subfolder(self): - return "source_subfolder" + def _min_cppstd(self): + return "11" if Version(self.version) < "0.20.0" else "17" @property - def _build_subfolder(self): - return "build_subfolder" + def _compilers_minimum_version(self): + return { + "17": { + "gcc": "8", + "clang": "7", + "apple-clang": "12", + "Visual Studio": "16", + "msvc": "192", + }, + }.get(self._min_cppstd, {}) + + def export_sources(self): + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -38,70 +52,78 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC - # This is a workround. - # If jsonnet is shared, rapidyaml must be built as shared, - # or the c4core functions that rapidyaml depends on will not be able to be found. - # This seems to be a issue of rapidyaml. - # https://github.com/conan-io/conan-center-index/pull/9786#discussion_r829887879 - if tools.Version(self.version) >= "0.18.0": - self.options["rapidyaml"].shared = True + self.options.rm_safe("fPIC") - def requirements(self): - self.requires("nlohmann_json/3.10.5") - if tools.Version(self.version) >= "0.18.0": - self.requires("rapidyaml/0.4.1") + def layout(self): + cmake_layout(self, src_folder="src") def validate(self): - if hasattr(self, "settings_build") and tools.cross_building(self, skip_x64_x86=True): - raise ConanInvalidConfiguration("jsonnet does not support cross building") + 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." + ) + + if Version(self.version) == "0.17.0" and Version(self.settings.compiler.get_safe("cppstd")) > "17": + raise ConanInvalidConfiguration(f"{self.ref} does not support C++{self.settings.compiler.cppstd}") - if self.settings.compiler.cppstd: - tools.check_min_cppstd(self, "11") + if hasattr(self, "settings_build") and cross_building(self, skip_x64_x86=True): + raise ConanInvalidConfiguration(f"{self.ref} does not support cross building") if self.options.shared and is_msvc(self) and "d" in msvc_runtime_flag(self): - raise ConanInvalidConfiguration("shared {} is not supported with MTd/MDd runtime".format(self.name)) + raise ConanInvalidConfiguration(f"shared {self.ref} is not supported with MTd/MDd runtime") - def export_sources(self): - self.copy("CMakeLists.txt") - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) + # This is a workround. + # If jsonnet is shared, rapidyaml must be built as shared, + # or the c4core functions that rapidyaml depends on will not be able to be found. + # This seems to be a issue of rapidyaml. + # https://github.com/conan-io/conan-center-index/pull/9786#discussion_r829887879 + if self.options.shared and Version(self.version) >= "0.18.0" and self.dependencies["rapidyaml"].options.shared == False: + raise ConanInvalidConfiguration(f"shared {self.ref} requires rapidyaml to be built as shared") - def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) + def requirements(self): + self.requires("nlohmann_json/3.11.2") + if Version(self.version) >= "0.18.0": + self.requires("rapidyaml/0.5.0") - @functools.lru_cache(1) - def _configure_cmake(self): - cmake = CMake(self) - cmake.definitions["BUILD_TESTS"] = False - cmake.definitions["BUILD_STATIC_LIBS"] = not self.options.shared - cmake.definitions["BUILD_SHARED_BINARIES"] = False - cmake.definitions["BUILD_JSONNET"] = False - cmake.definitions["BUILD_JSONNETFMT"] = False - cmake.definitions["USE_SYSTEM_JSON"] = True - cmake.configure(build_folder=self._build_subfolder) - return cmake + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_TESTS"] = False + tc.variables["BUILD_STATIC_LIBS"] = not self.options.shared + tc.variables["BUILD_SHARED_BINARIES"] = False + tc.variables["BUILD_JSONNET"] = False + tc.variables["BUILD_JSONNETFMT"] = False + tc.variables["USE_SYSTEM_JSON"] = True + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + tc.generate() + + deps = CMakeDeps(self) + deps.generate() def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - cmake = self._configure_cmake() + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): - self.copy("LICENSE", src=self._source_subfolder, dst="licenses") - cmake = self._configure_cmake() + copy(self, 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.components["libjsonnet"].libs = ["jsonnet"] self.cpp_info.components["libjsonnet"].requires = ["nlohmann_json::nlohmann_json"] - if tools.Version(self.version) >= "0.18.0": + if Version(self.version) >= "0.18.0": self.cpp_info.components["libjsonnet"].requires.append("rapidyaml::rapidyaml") - if tools.stdcpp_library(self): - self.cpp_info.components["libjsonnet"].system_libs.append(tools.stdcpp_library(self)) + if stdcpp_library(self): + self.cpp_info.components["libjsonnet"].system_libs.append(stdcpp_library(self)) if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.components["libjsonnet"].system_libs.append("m") diff --git a/recipes/jsonnet/all/patches/0.17.0/0002-cmake-fixes.patch b/recipes/jsonnet/all/patches/0.17.0/0002-cmake-fixes.patch index 6d8e892eb89a7..887943f82c372 100644 --- a/recipes/jsonnet/all/patches/0.17.0/0002-cmake-fixes.patch +++ b/recipes/jsonnet/all/patches/0.17.0/0002-cmake-fixes.patch @@ -1,32 +1,44 @@ -- install headers -- optionally disable shared build -- add md5 objects to c library -- allow MSVC ---- core/CMakeLists.txt -+++ core/CMakeLists.txt -@@ -16,8 +16,8 @@ set(LIBJSONNET_HEADERS - string_utils.h +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 385ea82..34b1c63 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -40,7 +40,7 @@ if (${CMAKE_CXX_COMPILER_ID} MATCHES "Clang" OR + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Wall -Wextra -Woverloaded-virtual -pedantic -std=c++11 -fPIC ${OPT}") + else() + # TODO: Windows support. +- message(FATAL_ERROR "Compiler ${CMAKE_CXX_COMPILER_ID} not supported") ++ message(WARNING "Compiler ${CMAKE_CXX_COMPILER_ID} not supported") + endif() + + set(CMAKE_CXX_STANDARD 11) +diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt +index e8ad830..7d87527 100644 +--- a/core/CMakeLists.txt ++++ b/core/CMakeLists.txt +@@ -17,7 +17,8 @@ set(LIBJSONNET_HEADERS unicode.h vm.h) -- + -set(LIBJSONNET_SOURCE +install(FILES ../include/libjsonnet.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) +set(LIBJSONNET_SOURCE $ desugarer.cpp formatter.cpp lexer.cpp -@@ -27,7 +27,7 @@ set(LIBJSONNET_SOURCE - static_analysis.cpp +@@ -28,6 +29,7 @@ set(LIBJSONNET_SOURCE string_utils.cpp vm.cpp) -- + +if (NOT BUILD_STATIC_LIBS) add_library(libjsonnet SHARED ${LIBJSONNET_HEADERS} ${LIBJSONNET_SOURCE}) add_dependencies(libjsonnet md5 stdlib) target_link_libraries(libjsonnet md5 nlohmann_json::nlohmann_json) -@@ -50,7 +50,7 @@ install(TARGETS libjsonnet +@@ -47,10 +49,10 @@ set_target_properties(libjsonnet PROPERTIES OUTPUT_NAME jsonnet + install(TARGETS libjsonnet + LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" + ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" - PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") -+ PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") ++ PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") target_include_directories(libjsonnet INTERFACE $) - @@ -34,9 +46,11 @@ if (BUILD_STATIC_LIBS) # Static library for jsonnet command-line tool. add_library(libjsonnet_static STATIC ${LIBJSONNET_SOURCE}) ---- cpp/CMakeLists.txt -+++ cpp/CMakeLists.txt -@@ -3,11 +3,11 @@ +diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt +index 5549902..3091a9c 100644 +--- a/cpp/CMakeLists.txt ++++ b/cpp/CMakeLists.txt +@@ -3,14 +3,14 @@ set(LIBJSONNETPP_HEADERS ../include/libjsonnet++.h ) @@ -51,7 +65,13 @@ add_dependencies(libjsonnet++ jsonnet) -# target_link_libraries(libjsonnet libjsonnet) +target_link_libraries(libjsonnet++ libjsonnet) -@@ -24,7 +24,7 @@ + + # CMake prepends CMAKE_SHARED_LIBRARY_PREFIX to shared libraries, so without + # this step the output would be |liblibjsonnet|. +@@ -21,10 +21,10 @@ set_target_properties(libjsonnet++ PROPERTIES OUTPUT_NAME jsonnet++ + install(TARGETS libjsonnet++ + LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" + ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" - PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") + PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") target_include_directories(libjsonnet++ INTERFACE @@ -61,20 +81,11 @@ if (BUILD_STATIC_LIBS) # Static library for jsonnet command-line tool. add_library(libjsonnet++_static STATIC ${LIBJSONNETPP_SOURCE}) ---- CMakeLists.txt -+++ CMakeLists.txt -@@ -40,7 +40,7 @@ - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Wall -Wextra -Woverloaded-virtual -pedantic -std=c++11 -fPIC ${OPT}") - else() - # TODO: Windows support. -- message(FATAL_ERROR "Compiler ${CMAKE_CXX_COMPILER_ID} not supported") -+ message(WARNING "Compiler ${CMAKE_CXX_COMPILER_ID} not supported") - endif() - - set(CMAKE_CXX_STANDARD 11) ---- stdlib/CMakeLists.txt -+++ stdlib/CMakeLists.txt -@@ -5,7 +5,7 @@ +diff --git a/stdlib/CMakeLists.txt b/stdlib/CMakeLists.txt +index a481d9f..00ff502 100644 +--- a/stdlib/CMakeLists.txt ++++ b/stdlib/CMakeLists.txt +@@ -5,7 +5,7 @@ add_executable(to_c_array to_c_array.cpp) # Custom command that will only build stdlib when it changes. add_custom_command( OUTPUT ${PROJECT_SOURCE_DIR}/core/std.jsonnet.h @@ -83,5 +94,3 @@ ${PROJECT_SOURCE_DIR}/stdlib/std.jsonnet ${PROJECT_SOURCE_DIR}/core/std.jsonnet.h DEPENDS to_c_array std.jsonnet) - - diff --git a/recipes/jsonnet/all/patches/0.18.0/0002-cmake-fixes.patch b/recipes/jsonnet/all/patches/0.18.0/0002-cmake-fixes.patch index 505ce96c21e93..58b0135ca2153 100644 --- a/recipes/jsonnet/all/patches/0.18.0/0002-cmake-fixes.patch +++ b/recipes/jsonnet/all/patches/0.18.0/0002-cmake-fixes.patch @@ -20,7 +20,7 @@ index 5df20ca..c14c93c 100644 add_subdirectory(cpp) add_subdirectory(cmd) diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt -index e62a858..c0389f8 100644 +index e62a858..f0fb69f 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -17,7 +17,8 @@ set(LIBJSONNET_HEADERS @@ -33,15 +33,21 @@ index e62a858..c0389f8 100644 desugarer.cpp formatter.cpp lexer.cpp -@@ -28,6 +29,7 @@ set(LIBJSONNET_SOURCE +@@ -28,9 +29,12 @@ set(LIBJSONNET_SOURCE string_utils.cpp vm.cpp) ++find_package(ryml REQUIRED CONFIG) ++ +if (NOT BUILD_STATIC_LIBS) add_library(libjsonnet SHARED ${LIBJSONNET_HEADERS} ${LIBJSONNET_SOURCE}) add_dependencies(libjsonnet md5 stdlib) - target_link_libraries(libjsonnet md5 nlohmann_json::nlohmann_json ryml) -@@ -47,10 +49,10 @@ set_target_properties(libjsonnet PROPERTIES OUTPUT_NAME jsonnet +-target_link_libraries(libjsonnet md5 nlohmann_json::nlohmann_json ryml) ++target_link_libraries(libjsonnet md5 nlohmann_json::nlohmann_json ryml::ryml) + + file(STRINGS ${CMAKE_CURRENT_SOURCE_DIR}/../include/libjsonnet.h JSONNET_VERSION_DEF + REGEX "[#]define[ \t]+LIB_JSONNET_VERSION[ \t]+") +@@ -47,15 +51,15 @@ set_target_properties(libjsonnet PROPERTIES OUTPUT_NAME jsonnet install(TARGETS libjsonnet LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" @@ -54,6 +60,12 @@ index e62a858..c0389f8 100644 if (BUILD_STATIC_LIBS) # Static library for jsonnet command-line tool. add_library(libjsonnet_static STATIC ${LIBJSONNET_SOURCE}) + add_dependencies(libjsonnet_static md5 stdlib) +- target_link_libraries(libjsonnet_static md5 nlohmann_json::nlohmann_json ryml) ++ target_link_libraries(libjsonnet_static md5 nlohmann_json::nlohmann_json ryml::ryml) + set_target_properties(libjsonnet_static PROPERTIES OUTPUT_NAME jsonnet) + install(TARGETS libjsonnet_static DESTINATION "${CMAKE_INSTALL_LIBDIR}") + target_include_directories(libjsonnet_static INTERFACE diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index eb7686c..cbf21bb 100644 --- a/cpp/CMakeLists.txt diff --git a/recipes/jsonnet/all/patches/0.20.0/0003-use-cpp17.patch b/recipes/jsonnet/all/patches/0.20.0/0003-use-cpp17.patch new file mode 100644 index 0000000000000..6735bb58adc58 --- /dev/null +++ b/recipes/jsonnet/all/patches/0.20.0/0003-use-cpp17.patch @@ -0,0 +1,14 @@ +iff --git a/CMakeLists.txt b/CMakeLists.txt +index c14c93c..b1cb1b3 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -43,7 +43,8 @@ else() + message(WARNING "Compiler ${CMAKE_CXX_COMPILER_ID} not supported") + endif() + +-set(CMAKE_CXX_STANDARD 11) ++# FIXME: This is a temporary workaround, necessary in MSVC only for version 0.20 and Conan 1.X ++set(CMAKE_CXX_STANDARD 17) + + + # Include external googletest project. This runs a CMake sub-script diff --git a/recipes/jsonnet/all/test_package/CMakeLists.txt b/recipes/jsonnet/all/test_package/CMakeLists.txt index b1f60f164ad79..ad42d5d0faada 100644 --- a/recipes/jsonnet/all/test_package/CMakeLists.txt +++ b/recipes/jsonnet/all/test_package/CMakeLists.txt @@ -1,14 +1,15 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES C CXX) find_package(jsonnet CONFIG REQUIRED) add_executable(${PROJECT_NAME}_c test_package.c) -target_link_libraries(${PROJECT_NAME}_c jsonnet::libjsonnet) +target_link_libraries(${PROJECT_NAME}_c PRIVATE jsonnet::libjsonnet) add_executable(${PROJECT_NAME}_cxx test_package.cpp) -target_link_libraries(${PROJECT_NAME}_cxx jsonnet::libjsonnetpp) -set_property(TARGET ${PROJECT_NAME}_cxx PROPERTY CXX_STANDARD 11) +target_link_libraries(${PROJECT_NAME}_cxx PRIVATE jsonnet::libjsonnetpp) +if(jsonnet_VERSION VERSION_LESS "0.20.0") + target_compile_features(${PROJECT_NAME}_cxx PRIVATE cxx_std_11) +else() + target_compile_features(${PROJECT_NAME}_cxx PRIVATE cxx_std_17) +endif() diff --git a/recipes/jsonnet/all/test_package/conanfile.py b/recipes/jsonnet/all/test_package/conanfile.py index 1460ef0546803..7f7fcbab40166 100644 --- a/recipes/jsonnet/all/test_package/conanfile.py +++ b/recipes/jsonnet/all/test_package/conanfile.py @@ -1,10 +1,18 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os - class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package_multi" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -12,6 +20,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - self.run(os.path.join("bin", "test_package_c"), run_environment=True) - self.run(os.path.join("bin", "test_package_cxx"), run_environment=True) + if can_run(self): + self.run(os.path.join(self.cpp.build.bindir, "test_package_c"), env="conanrun") + self.run(os.path.join(self.cpp.build.bindir, "test_package_cxx"), env="conanrun") diff --git a/recipes/jsonnet/all/test_v1_package/CMakeLists.txt b/recipes/jsonnet/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..be00a8c7f57c7 --- /dev/null +++ b/recipes/jsonnet/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/jsonnet/all/test_v1_package/conanfile.py b/recipes/jsonnet/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..25fbcb7a6d066 --- /dev/null +++ b/recipes/jsonnet/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): + self.run(os.path.join("bin", "test_package_c"), run_environment=True) + self.run(os.path.join("bin", "test_package_cxx"), run_environment=True) diff --git a/recipes/jsonnet/config.yml b/recipes/jsonnet/config.yml index d98d76db4349a..be300c9c5c2b0 100644 --- a/recipes/jsonnet/config.yml +++ b/recipes/jsonnet/config.yml @@ -1,4 +1,6 @@ versions: + "0.20.0": + folder: all "0.19.1": folder: all "0.18.0": From 7c88149503e838d0f76f00be9a0ce21d0942c20f Mon Sep 17 00:00:00 2001 From: "S. Messerschmidt" Date: Wed, 28 Jun 2023 20:27:23 +0200 Subject: [PATCH 32/59] (#16528) VulkanSceneGraph 1.0.0 ,1.0.3, 1.0.5 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * VulkanSceneGraph 1.0.0 inital configuration * style correction * style correction * style correction * added missing endline * Fixed/hacked license, fixed some warnings * reverted invalid change to shared-default option * Added version 1.3.0 * attempt to handle submodules (dependencies didn't work properly) * handling options * MT builds are no longer supported * Added new version to config.yml * Cleaning up in preparation to conan 2.0 compatiblity * removed inlcude and fixed removal of cmake Find- and Config files in package * Fixed broken packaging * Apply suggestions from code review Co-authored-by: Francisco Ramírez * Update recipes/vsg/all/conanfile.py Co-authored-by: Francisco Ramírez * Update recipes/vsg/all/conanfile.py Co-authored-by: Francisco Ramírez * Update recipes/vsg/all/conanfile.py Co-authored-by: Francisco Ramírez * added package_type and minor clean-up * Update recipes/vsg/all/conanfile.py * reworked former submodule handling * VSG now uses checkout of a branch instead * using scm facilities instead of self.run as proposed * fixed indentation issue * EOL fix * more EOL fixes * backed up from non-conforming conandata based approach * Update recipes/vsg/all/conanfile.py * preparing vsg 1.0.5 * removed glslang and therefore shadercompiler support for now * linter/style fixes * removed no longer needed imports * fixed some warnings * Remove test_v1, simplify code --------- Co-authored-by: Francisco Ramírez Co-authored-by: Rubén Rincón Blanco Co-authored-by: Luis Caro Campos <3535649+jcar87@users.noreply.github.com> Co-authored-by: Rubén Rincón Blanco --- recipes/vsg/all/conandata.yml | 10 ++ recipes/vsg/all/conanfile.py | 118 ++++++++++++++++++ recipes/vsg/all/test_package/CMakeLists.txt | 9 ++ recipes/vsg/all/test_package/conanfile.py | 27 ++++ recipes/vsg/all/test_package/test_package.cpp | 24 ++++ recipes/vsg/config.yml | 7 ++ 6 files changed, 195 insertions(+) create mode 100644 recipes/vsg/all/conandata.yml create mode 100644 recipes/vsg/all/conanfile.py create mode 100644 recipes/vsg/all/test_package/CMakeLists.txt create mode 100644 recipes/vsg/all/test_package/conanfile.py create mode 100644 recipes/vsg/all/test_package/test_package.cpp create mode 100644 recipes/vsg/config.yml diff --git a/recipes/vsg/all/conandata.yml b/recipes/vsg/all/conandata.yml new file mode 100644 index 0000000000000..f79242254e9e4 --- /dev/null +++ b/recipes/vsg/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "1.0.0": + url: "https://github.com/vsg-dev/VulkanSceneGraph/archive/refs/tags/VulkanSceneGraph-1.0.0.tar.gz" + sha256: "5611284f4256893ea97a33f9e99f5ecc8bdda110cc9fb7770b291fb45e8f9cf6" + "1.0.3": + url: "https://github.com/vsg-dev/VulkanSceneGraph/archive/refs/tags/VulkanSceneGraph-1.0.3.tar.gz" + sha256: "84aa1d445ecdd2702843f8f01e760d4db32c2ab3fe8c5d6122f8a83b67a50e36" + "1.0.5": + url: "https://github.com/vsg-dev/VulkanSceneGraph/archive/refs/tags/v1.0.5.tar.gz" + sha256: "ff58260fcb88d19d92c40a70bc40ff06abb1a8805568eb76862a036d13ada75b" diff --git a/recipes/vsg/all/conanfile.py b/recipes/vsg/all/conanfile.py new file mode 100644 index 0000000000000..104e5dc3d7219 --- /dev/null +++ b/recipes/vsg/all/conanfile.py @@ -0,0 +1,118 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.microsoft import check_min_vs, is_msvc_static_runtime, is_msvc +from conan.tools.files import get, copy, rm, rmdir, collect_libs +from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version +from conan.tools.cmake import CMakeToolchain, CMakeDeps, CMake +import os + +required_conan_version = ">=1.53.0" + +class VsgConan(ConanFile): + name = "vsg" + description = "VulkanSceneGraph" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.vulkanscenegraph.org" + topics = ("vulkan", "scenegraph", "graphics", "3d") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "max_devices": [1,2,3,4], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "max_devices" : 1, + "fPIC": True, + } + + @property + def _min_cppstd(self): + return 17 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "7", + "clang": "7", + "apple-clang": "10", + } + 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 requirements(self): + self.requires("vulkan-loader/1.3.239.0", transitive_headers=True) + + def validate(self): + if self.info.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) + check_min_vs(self, 191) + + if is_msvc_static_runtime(self): + raise ConanInvalidConfiguration(f"{self.name} does not support MSVC static runtime (MT/MTd) configurations, only dynamic runtime (MD/MDd) is supported") + + 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." + ) + + 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 is_msvc(self): + tc.variables["USE_MSVC_RUNTIME_LIBRARY_DLL"] = False + tc.variables["BUILD_SHARED_LIBS"] = self.options.shared + tc.variables["VSG_SUPPORTS_ShaderCompiler"] = 0 + tc.variables["VSG_MAX_DEVICES"] = self.options.max_devices + tc.generate() + + deps = CMakeDeps(self) + + deps.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, pattern="LICENSE.md", 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, "share")) + + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + rm(self, "*.pdb", os.path.join(self.package_folder, "lib")) + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) + rm(self, "Find*.cmake", os.path.join(self.package_folder, "lib/cmake/vsg")) + rm(self, "*Config.cmake", os.path.join(self.package_folder, "lib/cmake/vsg")) + + def package_info(self): + self.cpp_info.libs = collect_libs(self) + + self.cpp_info.set_property("cmake_file_name", "vsg") + self.cpp_info.set_property("cmake_target_name", "vsg::vsg") + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("pthread") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "vsg" + self.cpp_info.filenames["cmake_find_package_multi"] = "vsg" + self.cpp_info.names["cmake_find_package"] = "VSG" + self.cpp_info.names["cmake_find_package_multi"] = "vsg" diff --git a/recipes/vsg/all/test_package/CMakeLists.txt b/recipes/vsg/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..5b45e894695a3 --- /dev/null +++ b/recipes/vsg/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.8) + +project(test_package CXX) # if the project uses c++ + +find_package(vsg REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE vsg::vsg) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/vsg/all/test_package/conanfile.py b/recipes/vsg/all/test_package/conanfile.py new file mode 100644 index 0000000000000..1111583fea732 --- /dev/null +++ b/recipes/vsg/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/vsg/all/test_package/test_package.cpp b/recipes/vsg/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..ef112a2f69aaf --- /dev/null +++ b/recipes/vsg/all/test_package/test_package.cpp @@ -0,0 +1,24 @@ + +#include +#include +#include + + +#include + +#include +#include + +int main(int argc, char** argv) +{ + vsg::CommandLine arguments(&argc, argv); + auto numObjects = arguments.value(1u, {"---num-objects", "-n"}); + if (arguments.errors()) return arguments.writeErrorMessages(std::cerr); + + using Objects = std::vector>; + Objects objects; + objects.push_back(vsg::Node::create()); + + + return 0; +} diff --git a/recipes/vsg/config.yml b/recipes/vsg/config.yml new file mode 100644 index 0000000000000..058c041064a22 --- /dev/null +++ b/recipes/vsg/config.yml @@ -0,0 +1,7 @@ +versions: + "1.0.5": + folder: all + "1.0.3": + folder: all + "1.0.0": + folder: all From adf048f4b219c3b0ba661d8437b9bb81a16f221e Mon Sep 17 00:00:00 2001 From: Luis Caro Campos <3535649+jcar87@users.noreply.github.com> Date: Wed, 28 Jun 2023 20:01:56 +0100 Subject: [PATCH 33/59] (#18105) libpng: simplify patch logic * libpng: simplify patch logic * add missing endline --- .../all/conan_cmake_project_include.cmake | 7 +++ recipes/libpng/all/conandata.yml | 11 ---- recipes/libpng/all/conanfile.py | 29 +++------- .../patches/0001-1.5.30-cmakefile-zlib.patch | 49 ---------------- .../patches/0001-1.6.37-cmakefile-zlib.patch | 56 ------------------- 5 files changed, 15 insertions(+), 137 deletions(-) create mode 100644 recipes/libpng/all/conan_cmake_project_include.cmake delete mode 100644 recipes/libpng/all/patches/0001-1.5.30-cmakefile-zlib.patch delete mode 100644 recipes/libpng/all/patches/0001-1.6.37-cmakefile-zlib.patch diff --git a/recipes/libpng/all/conan_cmake_project_include.cmake b/recipes/libpng/all/conan_cmake_project_include.cmake new file mode 100644 index 0000000000000..e70fb28d5bf7d --- /dev/null +++ b/recipes/libpng/all/conan_cmake_project_include.cmake @@ -0,0 +1,7 @@ +# Older versions of libpng's CMakeLists reference the ZLIB_LIBRARy +# varible which was never officially documented. +# This was fixed in which first went into version 1.6.38. +# This can be deleted once the recipe no longer supports versions older than that. +# https://github.com/glennrp/libpng/commit/9f734b13f4ea062af98652c4c7678f667d2d85c7 +find_package(ZLIB CONFIG REQUIRED) +set(ZLIB_LIBRARY "${ZLIB_LIBRARIES}") diff --git a/recipes/libpng/all/conandata.yml b/recipes/libpng/all/conandata.yml index 040df395bad79..04e0b69ea4256 100644 --- a/recipes/libpng/all/conandata.yml +++ b/recipes/libpng/all/conandata.yml @@ -14,14 +14,3 @@ sources: "1.5.30": url: "https://sourceforge.net/projects/libpng/files/libpng15/1.5.30/libpng-1.5.30.tar.xz" sha256: "7d76275fad2ede4b7d87c5fd46e6f488d2a16b5a69dc968ffa840ab39ba756ed" -patches: - "1.6.37": - - patch_file: "patches/0001-1.6.37-cmakefile-zlib.patch" - patch_description: "Update ZLib include and library paths for conan to provide\ - \ lib. Remove Zlib dll definition." - patch_type: "conan" - "1.5.30": - - patch_file: "patches/0001-1.5.30-cmakefile-zlib.patch" - patch_description: "Update ZLib include and library paths for conan to provide\ - \ lib. Remove Zlib dll definition." - patch_type: "conan" diff --git a/recipes/libpng/all/conanfile.py b/recipes/libpng/all/conanfile.py index a67c210911f86..f8d672f0bb237 100644 --- a/recipes/libpng/all/conanfile.py +++ b/recipes/libpng/all/conanfile.py @@ -68,6 +68,7 @@ def _neon_msa_sse_vsx_mapping(self): def export_sources(self): export_conandata_patches(self) + copy(self, "conan_cmake_project_include.cmake", self.recipe_folder, os.path.join(self.export_sources_folder, "src")) def config_options(self): if self.settings.os == "Windows": @@ -102,11 +103,13 @@ def source(self): def generate(self): tc = CMakeToolchain(self) - tc.variables["PNG_TESTS"] = False - tc.variables["PNG_SHARED"] = self.options.shared - tc.variables["PNG_STATIC"] = not self.options.shared - tc.variables["PNG_DEBUG"] = self.settings.build_type == "Debug" - tc.variables["PNG_PREFIX"] = self.options.api_prefix + tc.cache_variables["PNG_TESTS"] = False + tc.cache_variables["PNG_SHARED"] = self.options.shared + tc.cache_variables["PNG_STATIC"] = not self.options.shared + tc.cache_variables["PNG_DEBUG"] = self.settings.build_type == "Debug" + tc.cache_variables["PNG_PREFIX"] = self.options.api_prefix + if Version(self.version) < "1.6.38": + tc.cache_variables["CMAKE_PROJECT_libpng_INCLUDE"] = os.path.join(self.source_folder, "conan_cmake_project_include.cmake") if self._has_neon_support: tc.variables["PNG_ARM_NEON"] = self._neon_msa_sse_vsx_mapping[str(self.options.neon)] if self._has_msa_support: @@ -125,22 +128,6 @@ def generate(self): def _patch_sources(self): apply_conandata_patches(self) - if self.settings.os == "Windows": - if not (is_msvc(self) or self._is_clang_cl): - if Version(self.version) < "1.6.38": - src_text = 'COMMAND "${CMAKE_COMMAND}" -E copy_if_different $ $/${DEST_FILE}' - elif Version(self.version) == "1.6.39": - src_text = '''COMMAND "${CMAKE_COMMAND}" - -E copy_if_different - $ - $/${DEST_FILE}''' - replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), - src_text, - 'COMMAND "${CMAKE_COMMAND}" -E copy_if_different $/$ $/${DEST_FILE}') - else: - # TODO: evaluate and document in what issue this patch aims to resolve, and in which scenarios it is needed - # Note: the cmake logic for this has changed again in versions >=1.6.40 - pass def build(self): self._patch_sources() diff --git a/recipes/libpng/all/patches/0001-1.5.30-cmakefile-zlib.patch b/recipes/libpng/all/patches/0001-1.5.30-cmakefile-zlib.patch deleted file mode 100644 index d78bd326e5e4c..0000000000000 --- a/recipes/libpng/all/patches/0001-1.5.30-cmakefile-zlib.patch +++ /dev/null @@ -1,49 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index b861195..8e3d2ca 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -41,7 +41,7 @@ set(PNGLIB_VERSION ${PNGLIB_MAJOR}.${PNGLIB_MINOR}.${PNGLIB_RELEASE}) - - # needed packages - find_package(ZLIB REQUIRED) --include_directories(${ZLIB_INCLUDE_DIR}) -+include_directories(${ZLIB_INCLUDE_DIRS}) - - if(NOT WIN32) - find_library(M_LIBRARY -@@ -312,7 +312,7 @@ if(PNG_DEBUG) - endif() - - # NOW BUILD OUR TARGET --include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${ZLIB_INCLUDE_DIR}) -+include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${ZLIB_INCLUDE_DIRS}) - - unset(PNG_LIB_TARGETS) - -@@ -326,7 +326,7 @@ if(PNG_SHARED) - set_target_properties(png PROPERTIES PREFIX "lib") - set_target_properties(png PROPERTIES IMPORT_PREFIX "lib") - endif() -- target_link_libraries(png ${ZLIB_LIBRARY} ${M_LIBRARY}) -+ target_link_libraries(png ${ZLIB_LIBRARIES} ${M_LIBRARY}) - - if(UNIX AND AWK) - if(HAVE_LD_VERSION_SCRIPT) -@@ -361,7 +361,7 @@ if(PNG_STATIC) - # msvc does not append 'lib' - do it here to have consistent name - set_target_properties(png_static PROPERTIES PREFIX "lib") - endif() -- target_link_libraries(png_static ${ZLIB_LIBRARY} ${M_LIBRARY}) -+ target_link_libraries(png_static ${ZLIB_LIBRARIES} ${M_LIBRARY}) - endif() - - if(PNG_FRAMEWORK) -@@ -378,7 +378,7 @@ if(PNG_FRAMEWORK) - XCODE_ATTRIBUTE_INSTALL_PATH "@rpath" - PUBLIC_HEADER "${libpng_public_hdrs}" - OUTPUT_NAME png) -- target_link_libraries(png_framework ${ZLIB_LIBRARY} ${M_LIBRARY}) -+ target_link_libraries(png_framework ${ZLIB_LIBRARIES} ${M_LIBRARY}) - endif() - - if(NOT PNG_LIB_TARGETS) diff --git a/recipes/libpng/all/patches/0001-1.6.37-cmakefile-zlib.patch b/recipes/libpng/all/patches/0001-1.6.37-cmakefile-zlib.patch deleted file mode 100644 index aaf8fda5cb495..0000000000000 --- a/recipes/libpng/all/patches/0001-1.6.37-cmakefile-zlib.patch +++ /dev/null @@ -1,56 +0,0 @@ ---- CMakeLists.txt 2019-04-14 20:10:32.000000000 +0200 -+++ CMakeLists.txt 2019-07-04 11:25:33.862280292 +0200 -@@ -40,7 +40,7 @@ - - if(NOT PNG_BUILD_ZLIB) - find_package(ZLIB REQUIRED) -- include_directories(${ZLIB_INCLUDE_DIR}) -+ include_directories(${ZLIB_INCLUDE_DIRS}) - endif() - - if(UNIX AND NOT APPLE AND NOT BEOS AND NOT HAIKU) -@@ -522,7 +522,7 @@ - endif() - - # NOW BUILD OUR TARGET --include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${ZLIB_INCLUDE_DIR}) -+include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${ZLIB_INCLUDE_DIRS}) - - unset(PNG_LIB_TARGETS) - -@@ -536,7 +536,7 @@ - set_target_properties(png PROPERTIES PREFIX "lib") - set_target_properties(png PROPERTIES IMPORT_PREFIX "lib") - endif() -- target_link_libraries(png ${ZLIB_LIBRARY} ${M_LIBRARY}) -+ target_link_libraries(png ${ZLIB_LIBRARIES} ${M_LIBRARY}) - - if(UNIX AND AWK) - if(HAVE_LD_VERSION_SCRIPT) -@@ -571,7 +571,7 @@ - # msvc does not append 'lib' - do it here to have consistent name - set_target_properties(png_static PROPERTIES PREFIX "lib") - endif() -- target_link_libraries(png_static ${ZLIB_LIBRARY} ${M_LIBRARY}) -+ target_link_libraries(png_static ${ZLIB_LIBRARIES} ${M_LIBRARY}) - endif() - - if(PNG_FRAMEWORK) -@@ -588,7 +588,7 @@ - XCODE_ATTRIBUTE_INSTALL_PATH "@rpath" - PUBLIC_HEADER "${libpng_public_hdrs}" - OUTPUT_NAME png) -- target_link_libraries(png_framework ${ZLIB_LIBRARY} ${M_LIBRARY}) -+ target_link_libraries(png_framework ${ZLIB_LIBRARIES} ${M_LIBRARY}) - endif() - - if(NOT PNG_LIB_TARGETS) -@@ -753,7 +753,7 @@ - set(PNG_BIN_TARGETS pngfix) - - add_executable(png-fix-itxt ${png_fix_itxt_sources}) -- target_link_libraries(png-fix-itxt ${ZLIB_LIBRARY} ${M_LIBRARY}) -+ target_link_libraries(png-fix-itxt ${ZLIB_LIBRARIES} ${M_LIBRARY}) - list(APPEND PNG_BIN_TARGETS png-fix-itxt) - endif() - From 570e57f4926b0ef9ac1ca4146cf5b08c732152df Mon Sep 17 00:00:00 2001 From: toge Date: Thu, 29 Jun 2023 13:01:52 +0900 Subject: [PATCH 34/59] (#18104) tsl-hopscotch-map: add version 2.3.1, add package_type --- recipes/tsl-hopscotch-map/all/conandata.yml | 3 +++ recipes/tsl-hopscotch-map/all/conanfile.py | 10 ++++------ recipes/tsl-hopscotch-map/config.yml | 2 ++ 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/recipes/tsl-hopscotch-map/all/conandata.yml b/recipes/tsl-hopscotch-map/all/conandata.yml index 6166a7c7730e6..191b340d98e5d 100644 --- a/recipes/tsl-hopscotch-map/all/conandata.yml +++ b/recipes/tsl-hopscotch-map/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.3.1": + url: "https://github.com/Tessil/hopscotch-map/archive/v2.3.1.tar.gz" + sha256: "53dab49005cd5dc859f2546d0d3eef058ec7fb3b74fc3b19f4965a9a151e9b20" "2.3.0": url: "https://github.com/Tessil/hopscotch-map/archive/v2.3.0.tar.gz" sha256: "a59d65b552dc7682521989842418c92257147f5068152b5af50e917892ad9317" diff --git a/recipes/tsl-hopscotch-map/all/conanfile.py b/recipes/tsl-hopscotch-map/all/conanfile.py index 6772f3c321bc9..cb1372f74dd49 100644 --- a/recipes/tsl-hopscotch-map/all/conanfile.py +++ b/recipes/tsl-hopscotch-map/all/conanfile.py @@ -11,9 +11,10 @@ class TslHopscotchMapConan(ConanFile): name = "tsl-hopscotch-map" license = "MIT" description = "C++ implementation of a fast hash map and hash set using hopscotch hashing" - topics = ("structure", "hash map", "hash set") - homepage = "https://github.com/Tessil/hopscotch-map" + topics = ("structure", "hash map", "hash set", "header-only") url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/Tessil/hopscotch-map" + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True @@ -28,8 +29,7 @@ def validate(self): check_min_cppstd(self, 11) def source(self): - get(self, **self.conan_data["sources"][self.version], - destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def build(self): pass @@ -43,7 +43,6 @@ def package_info(self): self.cpp_info.set_property("cmake_target_name", "tsl::hopscotch_map") self.cpp_info.bindirs = [] self.cpp_info.libdirs = [] - self.cpp_info.resdirs = [] # TODO: to remove in conan v2 once cmake_find_package* generators removed self.cpp_info.filenames["cmake_find_package"] = "tsl-hopscotch-map" @@ -55,4 +54,3 @@ def package_info(self): self.cpp_info.components["hopscotch_map"].set_property("cmake_target_name", "tsl::hopscotch_map") self.cpp_info.components["hopscotch_map"].bindirs = [] self.cpp_info.components["hopscotch_map"].libdirs = [] - self.cpp_info.components["hopscotch_map"].resdirs = [] diff --git a/recipes/tsl-hopscotch-map/config.yml b/recipes/tsl-hopscotch-map/config.yml index d724287fc23cb..7e1b2aadac1de 100644 --- a/recipes/tsl-hopscotch-map/config.yml +++ b/recipes/tsl-hopscotch-map/config.yml @@ -1,3 +1,5 @@ versions: + "2.3.1": + folder: all "2.3.0": folder: all From ce396c581ea8c905e77265a6a2a680c3345521af Mon Sep 17 00:00:00 2001 From: Holger Detering Date: Thu, 29 Jun 2023 09:42:15 +0200 Subject: [PATCH 35/59] (#18073) cute_headers: conan v2 support * cute_headers: conan v2 support * remove no longer used property --- recipes/cute_headers/all/conanfile.py | 39 +++++++++++-------- .../all/test_package/CMakeLists.txt | 12 ++---- .../all/test_package/conanfile.py | 18 +++++++-- 3 files changed, 41 insertions(+), 28 deletions(-) diff --git a/recipes/cute_headers/all/conanfile.py b/recipes/cute_headers/all/conanfile.py index 2aeb5719c6df9..5845ff0bcc925 100644 --- a/recipes/cute_headers/all/conanfile.py +++ b/recipes/cute_headers/all/conanfile.py @@ -1,39 +1,46 @@ -from conans import ConanFile, tools +from conan import ConanFile +from conan.tools.files import get, copy, load, save +from conan.tools.layout import basic_layout import os -import glob + + +required_conan_version = ">=1.52.0" class CuteHeadersConan(ConanFile): name = "cute_headers" description = "Various single-file cross-platform C/C++ headers implementing self-contained libraries." - topics = ("conan", "various", "pure-c") + topics = ("various", "pure-c") url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/RandyGaul/cute_headers" license = "Unlicense" + package_type = "header-library" no_copy_source = True def _extract_license(self): - file = os.path.join(self.package_folder, "include/cute_math2d.h") - file_content = tools.load(file) + file = os.path.join(self.package_folder, "include", "cute_math2d.h") + file_content = load(self, file) return file_content[file_content.rfind('/*'):] - @property - def _source_subfolder(self): - return "source_subfolder" + def layout(self): + basic_layout(self, src_folder="src") 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 package(self): - self.copy( + copy( + self, pattern="*.h", - dst="include", - src=self._source_subfolder, + dst=os.path.join(self.package_folder, "include"), + src=self.source_folder, excludes=("examples_cute_*", "test_cute_*") ) - tools.save(os.path.join(self.package_folder, "licenses", "LICENSE"), self._extract_license()) + save(self, os.path.join(self.package_folder, "licenses", "LICENSE"), self._extract_license()) def package_id(self): - self.info.header_only() + self.info.clear() + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/cute_headers/all/test_package/CMakeLists.txt b/recipes/cute_headers/all/test_package/CMakeLists.txt index b9be759ce7016..766b80640f9c1 100644 --- a/recipes/cute_headers/all/test_package/CMakeLists.txt +++ b/recipes/cute_headers/all/test_package/CMakeLists.txt @@ -1,11 +1,7 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(cute_headers REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries( - ${PROJECT_NAME} - ${CONAN_LIBS} -) +target_link_libraries(${PROJECT_NAME} PRIVATE cute_headers::cute_headers) diff --git a/recipes/cute_headers/all/test_package/conanfile.py b/recipes/cute_headers/all/test_package/conanfile.py index b63178709d69f..9be22ab3d97f8 100644 --- a/recipes/cute_headers/all/test_package/conanfile.py +++ b/recipes/cute_headers/all/test_package/conanfile.py @@ -1,10 +1,19 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os class TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" - generators = "cmake" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -12,5 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self.settings): - self.run(os.path.join("bin", "test_package"), run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") From 7f9676bb4de0eda6d9361226b2b582fdefa3f379 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Thu, 29 Jun 2023 09:22:21 +0100 Subject: [PATCH 36/59] (#18112) portable-file-dialogs: migrate to Conan v2 --- .../portable-file-dialogs/all/conanfile.py | 40 +++++++++++-------- .../all/test_package/CMakeLists.txt | 9 ++--- .../all/test_package/conanfile.py | 21 +++++++--- 3 files changed, 42 insertions(+), 28 deletions(-) diff --git a/recipes/portable-file-dialogs/all/conanfile.py b/recipes/portable-file-dialogs/all/conanfile.py index c45d2c0106dee..9ef96147823bf 100644 --- a/recipes/portable-file-dialogs/all/conanfile.py +++ b/recipes/portable-file-dialogs/all/conanfile.py @@ -1,36 +1,42 @@ import os -from conans import ConanFile, tools + +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout + +required_conan_version = ">=1.52.0" class PortableFileDialogsConan(ConanFile): name = "portable-file-dialogs" + description = "Portable GUI dialogs library, C++11, single-header" license = "WTFPL" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/samhocevar/portable-file-dialogs" - description = "Portable GUI dialogs library, C++11, single-header" - topics = ("conan", "gui", "dialogs") - no_copy_source = True - settings = "compiler" + topics = ("gui", "dialogs", "header-only") - @property - def _source_subfolder(self): - return "source_subfolder" + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True def configure(self): if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, 11) + check_min_cppstd(self, 11) + + 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("portable-file-dialogs.h", dst="include", src=self._source_subfolder) - self.copy("COPYING", dst="licenses", src=self._source_subfolder) - - def package_id(self): - self.info.header_only() + copy(self, "COPYING", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, "portable-file-dialogs.h", dst=os.path.join(self.package_folder, "include"), src=self.source_folder) def package_info(self): self.cpp_info.libdirs = [] + self.cpp_info.bindirs = [] diff --git a/recipes/portable-file-dialogs/all/test_package/CMakeLists.txt b/recipes/portable-file-dialogs/all/test_package/CMakeLists.txt index 33ae887aa6aea..c54c9c2b41cf2 100644 --- a/recipes/portable-file-dialogs/all/test_package/CMakeLists.txt +++ b/recipes/portable-file-dialogs/all/test_package/CMakeLists.txt @@ -1,9 +1,8 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(portable-file-dialogs REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE portable-file-dialogs::portable-file-dialogs) set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/portable-file-dialogs/all/test_package/conanfile.py b/recipes/portable-file-dialogs/all/test_package/conanfile.py index bd7165a553cf4..fae501d0afb9e 100644 --- a/recipes/portable-file-dialogs/all/test_package/conanfile.py +++ b/recipes/portable-file-dialogs/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" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self.settings): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") From 4ad387f5d842ae7b5953141b204728626ea576fc Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Thu, 29 Jun 2023 09:41:54 +0100 Subject: [PATCH 37/59] (#18118) ctml: migrate to Conan v2 --- recipes/ctml/all/conanfile.py | 39 +++++++++++++------- recipes/ctml/all/test_package/CMakeLists.txt | 5 +-- recipes/ctml/all/test_package/conanfile.py | 22 ++++++++--- 3 files changed, 43 insertions(+), 23 deletions(-) diff --git a/recipes/ctml/all/conanfile.py b/recipes/ctml/all/conanfile.py index b5c3dd7c38f7d..bb07e06f8fb0b 100644 --- a/recipes/ctml/all/conanfile.py +++ b/recipes/ctml/all/conanfile.py @@ -1,7 +1,12 @@ import os -from conans import ConanFile, tools -required_conan_version = ">=1.43.0" +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 + +required_conan_version = ">=1.52.0" + class CtmlLibrariesConan(ConanFile): name = "ctml" @@ -9,33 +14,41 @@ class CtmlLibrariesConan(ConanFile): license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/tinfoilboy/CTML" - topics = ("generator", "html", ) - settings = "os", "arch", "compiler", "build_type", - generators = "cmake", + topics = ("generator", "html", "header-only") + + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" no_copy_source = True - @property - def _source_subfolder(self): - return "source_subfolder" + def layout(self): + basic_layout(self, src_folder="src") def package_id(self): - self.info.header_only() + self.info.clear() def validate(self): if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, "11") + check_min_cppstd(self, 11) def source(self): - tools.get(**self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def package(self): - self.copy("LICENSE*", "licenses", self._source_subfolder) - self.copy("ctml.hpp", "include", os.path.join(self._source_subfolder, "include")) + copy(self, "LICENSE*", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder) + copy(self, "ctml.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", "CTML") self.cpp_info.set_property("cmake_target_name", "CTML::CTML") + # TODO: to remove in conan v2 once cmake_find_package_* generators removed self.cpp_info.filenames["cmake_find_package"] = "CTML" self.cpp_info.filenames["cmake_find_package_multi"] = "CTML" self.cpp_info.names["cmake_find_package"] = "CTML" diff --git a/recipes/ctml/all/test_package/CMakeLists.txt b/recipes/ctml/all/test_package/CMakeLists.txt index 1df60de830867..d4e16fb2704c6 100644 --- a/recipes/ctml/all/test_package/CMakeLists.txt +++ b/recipes/ctml/all/test_package/CMakeLists.txt @@ -1,9 +1,6 @@ -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.15) project(test_package CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - find_package(CTML CONFIG REQUIRED) add_executable(${PROJECT_NAME} test_package.cpp) diff --git a/recipes/ctml/all/test_package/conanfile.py b/recipes/ctml/all/test_package/conanfile.py index 270a1ae971491..fae501d0afb9e 100644 --- a/recipes/ctml/all/test_package/conanfile.py +++ b/recipes/ctml/all/test_package/conanfile.py @@ -1,9 +1,19 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os -from conans import ConanFile, CMake, tools -class TestWrapperConan(ConanFile): + +class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + generators = "CMakeDeps", "CMakeToolchain" + 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") From 557ac7cb6f84e7a11facae831d9b786e48556327 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Thu, 29 Jun 2023 10:01:44 +0100 Subject: [PATCH 38/59] (#18129) linux-headers-generic: migrate to Conan v2 --- .../linux-headers-generic/all/conanfile.py | 52 +++++++++++++------ .../all/test_package/CMakeLists.txt | 9 ++-- .../all/test_package/conanfile.py | 20 ++++--- 3 files changed, 53 insertions(+), 28 deletions(-) diff --git a/recipes/linux-headers-generic/all/conanfile.py b/recipes/linux-headers-generic/all/conanfile.py index 32a14abb318da..8179bf6408f18 100644 --- a/recipes/linux-headers-generic/all/conanfile.py +++ b/recipes/linux-headers-generic/all/conanfile.py @@ -1,22 +1,29 @@ -from conans import AutoToolsBuildEnvironment, ConanFile, tools -from conans.errors import ConanInvalidConfiguration import os -required_conan_version = ">=1.33.0" +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import cross_building +from conan.tools.files import chdir, copy, get +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout + +required_conan_version = ">=1.53.0" class LinuxHeadersGenericConan(ConanFile): name = "linux-headers-generic" + description = "Generic Linux kernel headers" + license = "GPL-2.0-only" url = "https://github.com/conan-io/conan-center-index" homepage = "https://www.kernel.org/" - license = "GPL-2.0-only" - description = "Generic Linux kernel headers" - topics = ("linux", "headers", "generic") - settings = "os", "arch", "build_type", "compiler" + topics = ("linux", "headers", "generic", "header-only") + + package_type = "header-library" + 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): del self.info.settings.os @@ -26,18 +33,29 @@ def package_id(self): def validate(self): if self.settings.os != "Linux": raise ConanInvalidConfiguration("linux-headers-generic supports only Linux") - if hasattr(self, "settings_build") and tools.cross_building(self): + if hasattr(self, "settings_build") and cross_building(self): raise ConanInvalidConfiguration("linux-headers-generic can not be cross-compiled") 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): + tc = AutotoolsToolchain(self) + tc.generate() def build(self): - with tools.chdir(os.path.join(self._source_subfolder)): - autotools = AutoToolsBuildEnvironment(self) + with chdir(self, self.source_folder): + autotools = Autotools(self) autotools.make(target="headers") def package(self): - self.copy("COPYING", dst="licenses", src=self._source_subfolder) - self.copy("include/*.h", src=os.path.join(self._source_subfolder, "usr")) + copy(self, "COPYING", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder) + copy(self, "include/*.h", + dst=self.package_folder, + src=os.path.join(self.source_folder, "usr")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/linux-headers-generic/all/test_package/CMakeLists.txt b/recipes/linux-headers-generic/all/test_package/CMakeLists.txt index 34af13462f44f..486ec186a2730 100644 --- a/recipes/linux-headers-generic/all/test_package/CMakeLists.txt +++ b/recipes/linux-headers-generic/all/test_package/CMakeLists.txt @@ -1,8 +1,7 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(linux-headers-generic REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE linux-headers-generic::linux-headers-generic) diff --git a/recipes/linux-headers-generic/all/test_package/conanfile.py b/recipes/linux-headers-generic/all/test_package/conanfile.py index 92074169bcc74..fae501d0afb9e 100644 --- a/recipes/linux-headers-generic/all/test_package/conanfile.py +++ b/recipes/linux-headers-generic/all/test_package/conanfile.py @@ -1,11 +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 -required_conan_version = ">=1.33.0" class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake" + generators = "CMakeDeps", "CMakeToolchain" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -13,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") From 9645cd6765768a62e5399acd3ed95a511e6d557e Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Thu, 29 Jun 2023 10:22:09 +0100 Subject: [PATCH 39/59] (#18127) nextsilicon-cpp-subprocess: migrate to Conan v2 --- .../all/conanfile.py | 49 ++++++++++++++----- .../all/test_package/CMakeLists.txt | 10 ++-- .../all/test_package/conanfile.py | 21 +++++--- 3 files changed, 55 insertions(+), 25 deletions(-) diff --git a/recipes/nextsilicon-cpp-subprocess/all/conanfile.py b/recipes/nextsilicon-cpp-subprocess/all/conanfile.py index cc556b383afc6..9fd2328668d3b 100644 --- a/recipes/nextsilicon-cpp-subprocess/all/conanfile.py +++ b/recipes/nextsilicon-cpp-subprocess/all/conanfile.py @@ -1,27 +1,50 @@ -from conans import ConanFile, tools +import os + +from conan import ConanFile +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout + +required_conan_version = ">=1.52.0" class CppSubprocess(ConanFile): name = "nextsilicon-cpp-subprocess" + description = ( + "Subprocessing with modern C++. " + "The only goal was to develop something that is as close as" + "Python subprocess module in dealing with processes." + ) license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/nextsilicon/cpp-subprocess" - topics = ("subprocess", "os", "fork") - description = ("Subprocessing with modern C++, " - "The only goal was to develop something that is as close as" - "python subprocess module in dealing with processes.") - no_copy_source = True + topics = ("subprocess", "os", "fork", "header-only") + + package_type = "header-library" 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() - _source_subfolder = 'cpp-subprocess' def source(self): - tools.get(**self.conan_data['sources'][self.version], - destination=self._source_subfolder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) + def package(self): - self.copy("subprocess.hpp", dst="include/cpp-subprocess", src=self._source_subfolder) - self.copy("LICENSE.MIT", dst="licenses", src=self._source_subfolder) + copy(self, "subprocess.hpp", + dst=os.path.join(self.package_folder, "include/cpp-subprocess"), + src=self.source_folder) + copy(self, "LICENSE.MIT", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder) - def package_id(self): - self.info.header_only() + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/nextsilicon-cpp-subprocess/all/test_package/CMakeLists.txt b/recipes/nextsilicon-cpp-subprocess/all/test_package/CMakeLists.txt index c61a7aada95ff..ccc5e64288292 100644 --- a/recipes/nextsilicon-cpp-subprocess/all/test_package/CMakeLists.txt +++ b/recipes/nextsilicon-cpp-subprocess/all/test_package/CMakeLists.txt @@ -1,14 +1,12 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() - set(CMAKE_CXX_STANDARD 11) -set(CMAKE_BUILD_TYPE Debug) set(THREADS_PREFER_PTHREAD_FLAG ON) + +find_package(nextsilicon-cpp-subprocess REQUIRED CONFIG) find_package(Threads REQUIRED) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS} Threads::Threads) +target_link_libraries(${PROJECT_NAME} PRIVATE nextsilicon-cpp-subprocess::nextsilicon-cpp-subprocess Threads::Threads) diff --git a/recipes/nextsilicon-cpp-subprocess/all/test_package/conanfile.py b/recipes/nextsilicon-cpp-subprocess/all/test_package/conanfile.py index fc4fe1905b49a..ef5d7042163ec 100644 --- a/recipes/nextsilicon-cpp-subprocess/all/test_package/conanfile.py +++ b/recipes/nextsilicon-cpp-subprocess/all/test_package/conanfile.py @@ -1,10 +1,19 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os -from conans import ConanFile, CMake, tools class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake" + 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") From 2597cca5baf8c489da1ba0cf869c3cb3978932f5 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Thu, 29 Jun 2023 10:41:45 +0100 Subject: [PATCH 40/59] (#18132) wglext: migrate to Conan v2 --- recipes/wglext/all/conanfile.py | 46 +++++++++++++------ .../wglext/all/test_package/CMakeLists.txt | 5 +- recipes/wglext/all/test_package/conanfile.py | 21 ++++++--- 3 files changed, 47 insertions(+), 25 deletions(-) diff --git a/recipes/wglext/all/conanfile.py b/recipes/wglext/all/conanfile.py index 916b363760c68..7af57d6410b8e 100644 --- a/recipes/wglext/all/conanfile.py +++ b/recipes/wglext/all/conanfile.py @@ -1,37 +1,53 @@ import os -from conans import ConanFile, tools -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import copy, download, load, save +from conan.tools.layout import basic_layout + +required_conan_version = ">=1.52.0" -required_conan_version = ">=1.37.0" class WglextConan(ConanFile): name = "wglext" + description = "WGL extension interfaces" license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://www.khronos.org/registry/OpenGL/index_gl.php" - description = "WGL extension interfaces" - topics = ("opengl", "gl", "wgl", "wglext") + topics = ("opengl", "gl", "wgl", "wglext", "header-only") + + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" no_copy_source = True - requires = "opengl/system" - settings = "os", + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("opengl/system") + + def package_id(self): + self.info.clear() def validate(self): if self.settings.os != "Windows": raise ConanInvalidConfiguration("wglext is only supported on Windows") def source(self): - tools.download(filename="wglext.h", **self.conan_data["sources"][self.version]) + download(self, filename="wglext.h", **self.conan_data["sources"][self.version]) - def package(self): - self.copy(pattern="wglext.h", dst=os.path.join("include", "GL")) - license_data = tools.load(os.path.join(self.source_folder, "wglext.h")) + def _extract_license(self): + license_data = load(self, os.path.join(self.source_folder, "wglext.h")) begin = license_data.find("/*") + len("/*") end = license_data.find("*/") license_data = license_data[begin:end] license_data = license_data.replace("**", "") - tools.save("LICENSE", license_data) - self.copy("LICENSE", dst="licenses") + save(self, os.path.join(self.package_folder, "licenses", "LICENSE"), license_data) - def package_id(self): - self.info.header_only() + def package(self): + self._extract_license() + copy(self, pattern="wglext.h", dst=os.path.join(self.package_folder, "include", "GL"), src=self.source_folder) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/wglext/all/test_package/CMakeLists.txt b/recipes/wglext/all/test_package/CMakeLists.txt index 121f8f8e30a8e..06dc988df0340 100644 --- a/recipes/wglext/all/test_package/CMakeLists.txt +++ b/recipes/wglext/all/test_package/CMakeLists.txt @@ -1,9 +1,6 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - find_package(wglext REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) diff --git a/recipes/wglext/all/test_package/conanfile.py b/recipes/wglext/all/test_package/conanfile.py index 49a3a66ea5bad..ef5d7042163ec 100644 --- a/recipes/wglext/all/test_package/conanfile.py +++ b/recipes/wglext/all/test_package/conanfile.py @@ -1,10 +1,19 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package_multi" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") From 72f15b3a9a8e876e33ed46b396dd2002c4e5d7c9 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Thu, 29 Jun 2023 11:01:53 +0100 Subject: [PATCH 41/59] (#18131) nv-codec-headers: migrate to Conan v2 --- recipes/nv-codec-headers/all/conanfile.py | 63 ++++++++++--------- .../all/test_package/CMakeLists.txt | 7 +-- .../all/test_package/conanfile.py | 21 +++++-- .../all/test_package/test_package.c | 2 +- 4 files changed, 54 insertions(+), 39 deletions(-) diff --git a/recipes/nv-codec-headers/all/conanfile.py b/recipes/nv-codec-headers/all/conanfile.py index b7d41a1b54635..b85d4da96e184 100644 --- a/recipes/nv-codec-headers/all/conanfile.py +++ b/recipes/nv-codec-headers/all/conanfile.py @@ -1,60 +1,67 @@ -from conans import ConanFile, AutoToolsBuildEnvironment, tools import os -required_conan_version = ">=1.35.0" +from conan import ConanFile +from conan.tools.files import chdir, get, load, rmdir, save +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout + +required_conan_version = ">=1.52.0" + class FFNvEncHeaders(ConanFile): name = "nv-codec-headers" description = "FFmpeg version of headers required to interface with Nvidia's codec APIs" - topics = ("ffmpeg", "video", "nvidia", "headers") + license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/FFmpeg/nv-codec-headers" - license = "MIT" - settings = "os" + topics = ("ffmpeg", "video", "nvidia", "headers", "header-only") - _autotools = None - _source_subfolder = "source_subfolder" + package_type = "header-library" + 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 package_id(self): + self.info.clear() + def build_requirements(self): if self._settings_build.os == "Windows": if "CONAN_MAKE_PROGRAM" not in os.environ: self.build_requires("make/4.2.1") - def package_id(self): - self.info.header_only() - 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 _configure_autotools(self): - if self._autotools: - return self._autotools - self._autotools = AutoToolsBuildEnvironment(self) - return self._autotools + def generate(self): + tc = AutotoolsToolchain(self) + tc.generate() def build(self): - autotools = self._configure_autotools() - with tools.chdir(os.path.join(self.build_folder, self._source_subfolder)): + with chdir(self, self.source_folder): + autotools = Autotools(self) autotools.make() def _extract_license(self): # Extract the License/s from the header to a file - tmp = tools.load(os.path.join(self._source_subfolder, "include", "ffnvcodec", "nvEncodeAPI.h")) - license_contents = tmp[2:tmp.find("*/", 1)] # The license begins with a C comment /* and ends with */ - tools.save(os.path.join(self.package_folder, "licenses", "LICENSE"), license_contents) + tmp = load(self, os.path.join(self.source_folder, "include", "ffnvcodec", "nvEncodeAPI.h")) + license_contents = tmp[2 : tmp.find("*/", 1)] # The license begins with a C comment /* and ends with */ + save(self, os.path.join(self.package_folder, "licenses", "LICENSE"), license_contents) def package(self): self._extract_license() - - autotools = self._configure_autotools() - with tools.chdir(os.path.join(self.build_folder, self._source_subfolder)): - autotools.install(args=["PREFIX={}".format(self.package_folder)]) - - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + with chdir(self, self.source_folder): + autotools = Autotools(self) + autotools.install(args=["PREFIX=/"]) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) def package_info(self): - self.cpp_info.names["pkg_config"] = "ffnvcodec" + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + self.cpp_info.set_property("pkg_config_name", "ffnvcodec") diff --git a/recipes/nv-codec-headers/all/test_package/CMakeLists.txt b/recipes/nv-codec-headers/all/test_package/CMakeLists.txt index 7b9b613cbb24a..a89c9eadf95fc 100644 --- a/recipes/nv-codec-headers/all/test_package/CMakeLists.txt +++ b/recipes/nv-codec-headers/all/test_package/CMakeLists.txt @@ -1,8 +1,7 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(nv-codec-headers REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE nv-codec-headers::nv-codec-headers) diff --git a/recipes/nv-codec-headers/all/test_package/conanfile.py b/recipes/nv-codec-headers/all/test_package/conanfile.py index bd7165a553cf4..ef5d7042163ec 100644 --- a/recipes/nv-codec-headers/all/test_package/conanfile.py +++ b/recipes/nv-codec-headers/all/test_package/conanfile.py @@ -1,10 +1,19 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self.settings): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/nv-codec-headers/all/test_package/test_package.c b/recipes/nv-codec-headers/all/test_package/test_package.c index 6742254a188e9..2cb0fd61df830 100644 --- a/recipes/nv-codec-headers/all/test_package/test_package.c +++ b/recipes/nv-codec-headers/all/test_package/test_package.c @@ -4,7 +4,7 @@ #include #include -int main () { +int main() { printf("hello NVENC API version %u.%u\n", NVENCAPI_MAJOR_VERSION, NVENCAPI_MINOR_VERSION); return EXIT_SUCCESS; } From 367aff08a0c450fb7929643939c0cd2fd33eb6ef Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Thu, 29 Jun 2023 11:22:07 +0100 Subject: [PATCH 42/59] (#18124) kainjow-mustache: migrate to Conan v2 --- recipes/kainjow-mustache/all/conanfile.py | 47 ++++++++++++------- .../all/test_package/CMakeLists.txt | 9 ++-- .../all/test_package/conanfile.py | 21 ++++++--- .../all/test_package/test_package.cpp | 21 ++++----- 4 files changed, 58 insertions(+), 40 deletions(-) diff --git a/recipes/kainjow-mustache/all/conanfile.py b/recipes/kainjow-mustache/all/conanfile.py index 5a235a430af98..0d2d3ee8e05e2 100644 --- a/recipes/kainjow-mustache/all/conanfile.py +++ b/recipes/kainjow-mustache/all/conanfile.py @@ -1,35 +1,48 @@ -from conans import ConanFile, tools import os -import glob + +from conan import ConanFile +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout + +required_conan_version = ">=1.52.0" class KainjowMustacheConan(ConanFile): name = "kainjow-mustache" description = "Mustache text templates for modern C++" - topics = ("conan", "mustache", "template") + license = "BSL-1.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/kainjow/Mustache" - license = "BSL-1.0" + topics = ("mustache", "template", "header-only") + + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" no_copy_source = True - @property - def _source_subfolder(self): - return "source_subfolder" + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() def source(self): - tools.get(**self.conan_data["sources"][self.version]) - os.rename( - "Mustache-{}".format(self.version), - self._source_subfolder - ) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def package(self): - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) - self.copy("mustache.hpp", dst=os.path.join("include", "kainjow"), src=self._source_subfolder) - - def package_id(self): - self.info.header_only() + copy(self, "LICENSE", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder) + copy(self, "mustache.hpp", + dst=os.path.join(self.package_folder, "include", "kainjow"), + src=self.source_folder) def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + self.cpp_info.set_property("cmake_file_name", "kainjow_mustache") + self.cpp_info.set_property("cmake_target_name", "kainjow_mustache::kainjow_mustache") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed self.cpp_info.names["cmake_find_package"] = "kainjow_mustache" self.cpp_info.names["cmake_find_package_multi"] = "kainjow_mustache" diff --git a/recipes/kainjow-mustache/all/test_package/CMakeLists.txt b/recipes/kainjow-mustache/all/test_package/CMakeLists.txt index 10c7c5ddbef7f..931342e8916cd 100644 --- a/recipes/kainjow-mustache/all/test_package/CMakeLists.txt +++ b/recipes/kainjow-mustache/all/test_package/CMakeLists.txt @@ -1,9 +1,8 @@ -cmake_minimum_required(VERSION 3.9) -project(test_package) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(kainjow_mustache REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE kainjow_mustache::kainjow_mustache) set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/kainjow-mustache/all/test_package/conanfile.py b/recipes/kainjow-mustache/all/test_package/conanfile.py index bd7165a553cf4..ef5d7042163ec 100644 --- a/recipes/kainjow-mustache/all/test_package/conanfile.py +++ b/recipes/kainjow-mustache/all/test_package/conanfile.py @@ -1,10 +1,19 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self.settings): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/kainjow-mustache/all/test_package/test_package.cpp b/recipes/kainjow-mustache/all/test_package/test_package.cpp index e2d83b0f477ec..d45d847b4bf07 100644 --- a/recipes/kainjow-mustache/all/test_package/test_package.cpp +++ b/recipes/kainjow-mustache/all/test_package/test_package.cpp @@ -1,18 +1,15 @@ -#include #include "kainjow/mustache.hpp" - +#include int main() { - using namespace kainjow::mustache; + using namespace kainjow::mustache; - mustache tmpl{"{{#employees}}{{name}}{{#comma}}, {{/comma}}{{/employees}}"}; - data employees{data::type::list}; - employees - << object{{"name", "Steve"}, {"comma", true}} - << object{{"name", "Bill"}}; + mustache tmpl{"{{#employees}}{{name}}{{#comma}}, {{/comma}}{{/employees}}"}; + data employees{data::type::list}; + employees << object{{"name", "Steve"}, {"comma", true}} << object{{"name", "Bill"}}; - if( tmpl.render({"employees", employees}) == "Steve, Bill" ) { - return 0; - } - return 1; + if (tmpl.render({"employees", employees}) == "Steve, Bill") { + return 0; + } + return 1; } From 488721e57dd3caa753b3d1480818d326a5b40f12 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Thu, 29 Jun 2023 11:42:33 +0100 Subject: [PATCH 43/59] (#18121) fire-hpp: migrate to Conan v2 --- recipes/fire-hpp/all/conanfile.py | 65 +++++++++++-------- .../fire-hpp/all/test_package/CMakeLists.txt | 7 +- .../fire-hpp/all/test_package/conanfile.py | 22 +++++-- .../all/test_package/test_package.cpp | 4 +- 4 files changed, 57 insertions(+), 41 deletions(-) diff --git a/recipes/fire-hpp/all/conanfile.py b/recipes/fire-hpp/all/conanfile.py index e2770d10a2f50..79b1be52cfefe 100644 --- a/recipes/fire-hpp/all/conanfile.py +++ b/recipes/fire-hpp/all/conanfile.py @@ -1,43 +1,54 @@ -from conans import ConanFile, CMake, tools import os +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, rmdir + +required_conan_version = ">=1.52.0" + + class FireHppConan(ConanFile): name = "fire-hpp" - homepage = "https://github.com/kongaskristjan/fire-hpp" - url = "https://github.com/conan-io/conan-center-index" description = "Fire for C++: Create fully functional CLIs using function signatures" - topics = ("command-line", "argument", "parser") license = "BSL-1.0" - no_copy_source = True - settings = "os", "arch", "compiler", "build_type" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/kongaskristjan/fire-hpp" + topics = ("command-line", "argument", "parser", "header-only") - _source_subfolder = "source_subfolder" - _build_subfolder = "build_subfolder" - _cmake = None + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" def configure(self): if self.settings.compiler.cppstd: - tools.check_min_cppstd(self, 11) + check_min_cppstd(self, 11) + + def layout(self): + cmake_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 = "{}-{}".format(self.name, self.version) - os.rename(extracted_dir, self._source_subfolder) - - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["FIRE_EXAMPLES"] = False - self._cmake.definitions["FIRE_UNIT_TESTS"] = False - self._cmake.configure(source_folder=self._source_subfolder, build_folder=self._build_subfolder) - return self._cmake + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["FIRE_EXAMPLES"] = False + tc.variables["FIRE_UNIT_TESTS"] = False + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() def package(self): - cmake = self._configure_cmake() + cmake = CMake(self) cmake.install() - self.copy("LICENCE", dst="licenses", src=self._source_subfolder) - tools.rmdir(os.path.join(self.package_folder, "lib")) + copy(self, "LICENCE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + rmdir(self, os.path.join(self.package_folder, "lib")) - def package_id(self): - self.info.header_only() + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/fire-hpp/all/test_package/CMakeLists.txt b/recipes/fire-hpp/all/test_package/CMakeLists.txt index 520f51ea73d4a..8068292a31341 100644 --- a/recipes/fire-hpp/all/test_package/CMakeLists.txt +++ b/recipes/fire-hpp/all/test_package/CMakeLists.txt @@ -1,10 +1,7 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() - -find_package(fire-hpp REQUIRED) +find_package(fire-hpp REQUIRED CONFIG) add_executable(${CMAKE_PROJECT_NAME} test_package.cpp) target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE fire-hpp::fire-hpp) diff --git a/recipes/fire-hpp/all/test_package/conanfile.py b/recipes/fire-hpp/all/test_package/conanfile.py index b6680c7d91280..1d145d1d569ec 100644 --- a/recipes/fire-hpp/all/test_package/conanfile.py +++ b/recipes/fire-hpp/all/test_package/conanfile.py @@ -1,10 +1,19 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os -from conans import ConanFile, CMake, tools class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -12,7 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self.settings): - bin_path = os.path.join("bin", "test_package") - bin_args = "-x=1 -y=2" - self.run("{} {}".format(bin_path, bin_args), run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(f"{bin_path} -x=1 -y=2", env="conanrun") diff --git a/recipes/fire-hpp/all/test_package/test_package.cpp b/recipes/fire-hpp/all/test_package/test_package.cpp index 614e5b1984d23..39e02ea0720f9 100644 --- a/recipes/fire-hpp/all/test_package/test_package.cpp +++ b/recipes/fire-hpp/all/test_package/test_package.cpp @@ -2,8 +2,8 @@ #include int fired_main(int x = fire::arg("-x"), int y = fire::arg("-y")) { - std::cout << x + y << std::endl; - return 0; + std::cout << x + y << std::endl; + return 0; } FIRE(fired_main) From 8d6835839924db814a4c5053829f8764480aa19e Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Thu, 29 Jun 2023 12:34:00 +0100 Subject: [PATCH 44/59] (#18135) nextsilicon-cpp-subprocess: add cppstd check, fix typo Follow-up to https://github.com/conan-io/conan-center-index/pull/18127/files#r1246355487 --- .../nextsilicon-cpp-subprocess/all/conanfile.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/recipes/nextsilicon-cpp-subprocess/all/conanfile.py b/recipes/nextsilicon-cpp-subprocess/all/conanfile.py index 9fd2328668d3b..01f1e1a74c95e 100644 --- a/recipes/nextsilicon-cpp-subprocess/all/conanfile.py +++ b/recipes/nextsilicon-cpp-subprocess/all/conanfile.py @@ -1,6 +1,7 @@ import os from conan import ConanFile +from conan.tools.build import check_min_cppstd from conan.tools.files import copy, get from conan.tools.layout import basic_layout @@ -11,8 +12,8 @@ class CppSubprocess(ConanFile): name = "nextsilicon-cpp-subprocess" description = ( "Subprocessing with modern C++. " - "The only goal was to develop something that is as close as" - "Python subprocess module in dealing with processes." + "The only goal was to develop something that is as close as possible" + " to the Python subprocess module in dealing with processes." ) license = "MIT" url = "https://github.com/conan-io/conan-center-index" @@ -23,19 +24,23 @@ class CppSubprocess(ConanFile): 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() + @property + def _min_cppstd(self): + return 11 + + def validate(self): + if self.settings.compiler.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, "subprocess.hpp", dst=os.path.join(self.package_folder, "include/cpp-subprocess"), @@ -44,7 +49,6 @@ def package(self): dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) - def package_info(self): self.cpp_info.bindirs = [] self.cpp_info.libdirs = [] From 9a3bb45d573fc0a58d456d5e79d5ad46a02af669 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Thu, 29 Jun 2023 13:02:21 +0100 Subject: [PATCH 45/59] (#18116) icecream-cpp: migrate to Conan v2 --- recipes/icecream-cpp/all/conanfile.py | 53 +++++++++++-------- .../all/test_package/CMakeLists.txt | 7 ++- .../all/test_package/conanfile.py | 22 +++++--- 3 files changed, 48 insertions(+), 34 deletions(-) diff --git a/recipes/icecream-cpp/all/conanfile.py b/recipes/icecream-cpp/all/conanfile.py index ad2f369b0f440..472b8f9d1ba62 100644 --- a/recipes/icecream-cpp/all/conanfile.py +++ b/recipes/icecream-cpp/all/conanfile.py @@ -1,42 +1,49 @@ -from conans import ConanFile, tools -from conans.errors import ConanInvalidConfiguration +import os -required_conan_version = ">=1.33.0" +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +from conan.tools.scm import Version + +required_conan_version = ">=1.52.0" class IcecreamcppConan(ConanFile): name = "icecream-cpp" + description = "A little library to help with the print debugging on C++11 and forward." license = "MIT" - homepage = "https://github.com/renatoGarcia/icecream-cpp" url = "https://github.com/conan-io/conan-center-index" - description = "A little library to help with the print debugging on C++11 and forward." - topics = ("debug", "single-header-lib", "print") - settings = "compiler" + homepage = "https://github.com/renatoGarcia/icecream-cpp" + topics = ("debug", "single-header-lib", "print", "header-only") + + package_type = "header-library" + 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"): - tools.check_min_cppstd(self, 11) + check_min_cppstd(self, 11) - if self.settings.compiler == "gcc" and tools.Version(self.settings.compiler.version) < "5": + if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "5": raise ConanInvalidConfiguration( - "icecream-cpp can't be used by {0} {1}".format( - self.settings.compiler, - self.settings.compiler.version - ) + f"icecream-cpp can't be used by {self.settings.compiler} {self.settings.compiler.version}" ) - 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], strip_root=True) def package(self): - self.copy("LICENSE.txt", dst="licenses", src=self._source_subfolder) - self.copy("icecream.hpp", dst="include", src=self._source_subfolder) + copy(self, "LICENSE.txt", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, "icecream.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 = [] diff --git a/recipes/icecream-cpp/all/test_package/CMakeLists.txt b/recipes/icecream-cpp/all/test_package/CMakeLists.txt index 6aab347eddf53..5b9d4de6b2558 100644 --- a/recipes/icecream-cpp/all/test_package/CMakeLists.txt +++ b/recipes/icecream-cpp/all/test_package/CMakeLists.txt @@ -1,9 +1,8 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(PackageTest CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(icecream-cpp REQUIRED CONFIG) add_executable(example example.cpp) -target_link_libraries(example ${CONAN_LIBS}) +target_link_libraries(example PRIVATE icecream-cpp::icecream-cpp) set_property(TARGET example PROPERTY CXX_STANDARD 11) diff --git a/recipes/icecream-cpp/all/test_package/conanfile.py b/recipes/icecream-cpp/all/test_package/conanfile.py index 186ee2682166d..e0f447388fa1b 100644 --- a/recipes/icecream-cpp/all/test_package/conanfile.py +++ b/recipes/icecream-cpp/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" + test_type = "explicit" -class IcecreamcppTestConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake" + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -13,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self.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.bindir, "example") + self.run(bin_path, env="conanrun") From de39d21490f041e94cfd546d5842b3e0fd815aca Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Thu, 29 Jun 2023 13:21:53 +0100 Subject: [PATCH 46/59] (#18114) greatest: migrate to Conan v2 --- recipes/greatest/all/conanfile.py | 31 +++++++++++++------ .../greatest/all/test_package/CMakeLists.txt | 7 ++--- .../greatest/all/test_package/conanfile.py | 21 +++++++++---- 3 files changed, 39 insertions(+), 20 deletions(-) diff --git a/recipes/greatest/all/conanfile.py b/recipes/greatest/all/conanfile.py index cda1c077e6c1d..24675294fec7f 100644 --- a/recipes/greatest/all/conanfile.py +++ b/recipes/greatest/all/conanfile.py @@ -1,4 +1,10 @@ -from conans import ConanFile, tools +import os + +from conan import ConanFile +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout + +required_conan_version = ">=1.52.0" class GreatestConan(ConanFile): @@ -8,19 +14,24 @@ class GreatestConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/silentbicycle/greatest" topics = ("testing", "testing-framework", "unit-testing", "header-only") + + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" no_copy_source = True - @property - def _source_subfolder(self): - return "source_subfolder" + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) + 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("greatest.h", dst="include", src=self._source_subfolder) + copy(self, "LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, "greatest.h", dst=os.path.join(self.package_folder, "include"), src=self.source_folder) - def package_id(self): - self.info.header_only() + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/greatest/all/test_package/CMakeLists.txt b/recipes/greatest/all/test_package/CMakeLists.txt index a5ffd526aaea7..7ddc15d912feb 100644 --- a/recipes/greatest/all/test_package/CMakeLists.txt +++ b/recipes/greatest/all/test_package/CMakeLists.txt @@ -1,8 +1,7 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(greatest REQUIRED CONFIG) add_executable(${CMAKE_PROJECT_NAME} test_package.c) -target_link_libraries(${CMAKE_PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${CMAKE_PROJECT_NAME} greatest::greatest) diff --git a/recipes/greatest/all/test_package/conanfile.py b/recipes/greatest/all/test_package/conanfile.py index d4128b0450777..fae501d0afb9e 100644 --- a/recipes/greatest/all/test_package/conanfile.py +++ b/recipes/greatest/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" + 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") From 0435fc5726fa70e1b21b1ee1b60145b19fe7c089 Mon Sep 17 00:00:00 2001 From: Conan Center Index Bot <54393557+conan-center-bot@users.noreply.github.com> Date: Thu, 29 Jun 2023 14:41:37 +0200 Subject: [PATCH 47/59] (#18139) [bot] Update authorized users list (2023-06-29) --- .c3i/authorized_users.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.c3i/authorized_users.yml b/.c3i/authorized_users.yml index a9010918eb015..45782a0fc1900 100644 --- a/.c3i/authorized_users.yml +++ b/.c3i/authorized_users.yml @@ -1182,3 +1182,6 @@ authorized_users: - ChrisThrasher - ViktarHasiul231862 - Becheler +- jalapenopuzzle +- HalfSweet +- CJCombrink From 2633bef462e4a10f61e7e40f1f185e8735975376 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Thu, 29 Jun 2023 14:03:06 +0100 Subject: [PATCH 48/59] (#18110) stringtoolbox: migrate to Conan v2 --- recipes/stringtoolbox/all/conanfile.py | 40 ++++++++++++------- .../all/test_package/CMakeLists.txt | 7 +--- .../all/test_package/conanfile.py | 24 +++++++---- 3 files changed, 44 insertions(+), 27 deletions(-) diff --git a/recipes/stringtoolbox/all/conanfile.py b/recipes/stringtoolbox/all/conanfile.py index c1426333ba094..1753e2bcb8a5f 100644 --- a/recipes/stringtoolbox/all/conanfile.py +++ b/recipes/stringtoolbox/all/conanfile.py @@ -1,31 +1,41 @@ -from conans import ConanFile, tools +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.52.0" -required_conan_version = ">=1.33.0" class DawHeaderLibrariesConan(ConanFile): name = "stringtoolbox" - license = "MIT" description = "A simple header-only, single-file string toolbox library for C++." - topics = ("string", "header-only",) + license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/chrberger/stringtoolbox" - settings = "os", "arch", "compiler", "build_type", + topics = ("string", "header-only") + + package_type = "header-library" + 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.get_safe("compiler.cppstd"): - tools.check_min_cppstd(self, "11") - - def package_id(self): - self.info.header_only() + check_min_cppstd(self, 11) def source(self): - tools.get(**self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def package(self): - self.copy("LICENSE*", "licenses", self._source_subfolder) - self.copy("stringtoolbox.hpp", "include", self._source_subfolder) + copy(self, "LICENSE*", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, "stringtoolbox.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 = [] diff --git a/recipes/stringtoolbox/all/test_package/CMakeLists.txt b/recipes/stringtoolbox/all/test_package/CMakeLists.txt index 76fbeefd9810e..012002471f6a4 100644 --- a/recipes/stringtoolbox/all/test_package/CMakeLists.txt +++ b/recipes/stringtoolbox/all/test_package/CMakeLists.txt @@ -1,10 +1,7 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(stringtoolbox CONFIG REQUIRED) +find_package(stringtoolbox REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} stringtoolbox::stringtoolbox) diff --git a/recipes/stringtoolbox/all/test_package/conanfile.py b/recipes/stringtoolbox/all/test_package/conanfile.py index de03d357e14e0..ef5d7042163ec 100644 --- a/recipes/stringtoolbox/all/test_package/conanfile.py +++ b/recipes/stringtoolbox/all/test_package/conanfile.py @@ -1,9 +1,19 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os -from conans import ConanFile, CMake, tools -class DawHeaderLibrariesTestConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package_multi" + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -11,6 +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") From df8344adc55ca07cae7130d6d91cde0f230cce62 Mon Sep 17 00:00:00 2001 From: Rasmus Thomsen Date: Thu, 29 Jun 2023 15:23:17 +0200 Subject: [PATCH 49/59] (#18034) opentelemetry: fixup requirements * opentelemetry-cpp: fixup requirements Some of these tool requirements are only needed with some options enabled * opentelemetry-cpp: bump boost dependency --- recipes/opentelemetry-cpp/all/conanfile.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/recipes/opentelemetry-cpp/all/conanfile.py b/recipes/opentelemetry-cpp/all/conanfile.py index c56f8d1fa1129..7d1799e99839a 100644 --- a/recipes/opentelemetry-cpp/all/conanfile.py +++ b/recipes/opentelemetry-cpp/all/conanfile.py @@ -126,7 +126,7 @@ def requirements(self): self.requires("thrift/0.17.0") if Version(self.version) >= "1.3.0": - self.requires("boost/1.81.0") + self.requires("boost/1.82.0") @property def _required_boost_components(self): @@ -146,8 +146,9 @@ def validate(self): if self.options.get_safe("with_otlp_http") and not self.options.with_otlp: raise ConanInvalidConfiguration("Option 'with_otlp_http' requires 'with_otlp'") - if not self.dependencies["grpc"].options.cpp_plugin: - raise ConanInvalidConfiguration(f"{self.ref} requires grpc with cpp_plugin=True") + if self.options.get_safe("with_otlp_grpc"): + if not self.dependencies["grpc"].options.cpp_plugin: + raise ConanInvalidConfiguration(f"{self.ref} requires grpc with cpp_plugin=True") boost_required_comp = any(self.dependencies["boost"].options.get_safe(f"without_{boost_comp}", True) for boost_comp in self._required_boost_components) @@ -159,8 +160,10 @@ def validate(self): ) def build_requirements(self): - self.tool_requires("protobuf/3.21.9") - self.tool_requires("grpc/1.50.1") + if self.options.with_otlp: + self.tool_requires("protobuf/3.21.9") + if self.options.get_safe("with_otlp_grpc"): + self.tool_requires("grpc/1.50.1") def _create_cmake_module_variables(self, module_file): content = textwrap.dedent("""\ @@ -440,6 +443,7 @@ def package_info(self): self.options.with_elasticsearch ): self.cpp_info.components[self._http_client_name].requires.append("libcurl::libcurl") + self.cpp_info.components[self._http_client_name].requires.append("openssl::openssl") if self.options.get_safe("with_otlp_http"): self.cpp_info.components["opentelemetry_exporter_otlp_http_client"].requires.extend([ From c92ee911405149cad095c54a111d490db6b7741f Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Thu, 29 Jun 2023 15:02:14 +0100 Subject: [PATCH 50/59] (#18126) mattiasgustavsson-libs: migrate to Conan v2 * mattiasgustavsson-libs: migrate to Conan v2 * mattiasgustavsson-libs: undo addition of cxx_std_11 in test_package No min cppstd check is done in the recipe, so this should not be necessary. * mattiasgustavsson-libs: add check_min_cppstd * mattiasgustavsson-libs: fix license extraction --- .../mattiasgustavsson-libs/all/conanfile.py | 58 ++++++++++++------- .../all/test_package/CMakeLists.txt | 7 +-- .../all/test_package/conanfile.py | 21 +++++-- 3 files changed, 55 insertions(+), 31 deletions(-) diff --git a/recipes/mattiasgustavsson-libs/all/conanfile.py b/recipes/mattiasgustavsson-libs/all/conanfile.py index bfba3abb27bab..064ab9c964c61 100644 --- a/recipes/mattiasgustavsson-libs/all/conanfile.py +++ b/recipes/mattiasgustavsson-libs/all/conanfile.py @@ -1,37 +1,53 @@ -from conans import ConanFile, tools -import os.path -import glob +import os + +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get, load, save +from conan.tools.layout import basic_layout + +required_conan_version = ">=1.52.0" + class MattiasgustavssonLibsConan(ConanFile): name = "mattiasgustavsson-libs" description = "Single-file public domain libraries for C/C++" - homepage = "https://github.com/mattiasgustavsson/libs" - url = "https://github.com/conan-io/conan-center-index" license = ("Unlicense", "MIT") - topics = ("utilities", "mattiasgustavsson", "libs") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/mattiasgustavsson/libs" + topics = ("utilities", "mattiasgustavsson", "libs", "header-only") + + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" no_copy_source = True @property - def _source_subfolder(self): - return os.path.join(self.source_folder, "source_subfolder") + def _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.cppstd: + check_min_cppstd(self, self._min_cppstd) def source(self): - tools.get(**self.conan_data["sources"][self.version]) - extracted_dir = glob.glob('libs-*/')[0] - os.rename(extracted_dir, self._source_subfolder) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def _extract_licenses(self): - header = tools.load(os.path.join(self._source_subfolder, "thread.h")) - mit_content = header[header.find("ALTERNATIVE A - "):header.find("ALTERNATIVE B -")] - tools.save("LICENSE_MIT", mit_content) - unlicense_content = header[header.find("ALTERNATIVE B - "):header.rfind("*/", 1)] - tools.save("LICENSE_UNLICENSE", unlicense_content) + header = load(self, os.path.join(self.source_folder, "thread.h")) + mit_content = header[header.find("ALTERNATIVE A - ") : header.find("ALTERNATIVE B -")] + save(self, os.path.join(self.package_folder, "licenses", "LICENSE_MIT"), mit_content) + unlicense_content = header[header.find("ALTERNATIVE B - ") : header.rfind("*/", 1)] + save(self, os.path.join(self.package_folder, "licenses", "LICENSE_UNLICENSE"), unlicense_content) def package(self): - self.copy(pattern="*.h", dst="include", src=self._source_subfolder) self._extract_licenses() - self.copy("LICENSE_MIT", dst="licenses") - self.copy("LICENSE_UNLICENSE", dst="licenses") + copy(self, pattern="*.h", dst=os.path.join(self.package_folder, "include"), src=self.source_folder) - def package_id(self): - self.info.header_only() + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/mattiasgustavsson-libs/all/test_package/CMakeLists.txt b/recipes/mattiasgustavsson-libs/all/test_package/CMakeLists.txt index 7557711b6dc83..fe3e7c23a7d9b 100644 --- a/recipes/mattiasgustavsson-libs/all/test_package/CMakeLists.txt +++ b/recipes/mattiasgustavsson-libs/all/test_package/CMakeLists.txt @@ -1,8 +1,7 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(mattiasgustavsson-libs REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE mattiasgustavsson-libs::mattiasgustavsson-libs) diff --git a/recipes/mattiasgustavsson-libs/all/test_package/conanfile.py b/recipes/mattiasgustavsson-libs/all/test_package/conanfile.py index bd7165a553cf4..fae501d0afb9e 100644 --- a/recipes/mattiasgustavsson-libs/all/test_package/conanfile.py +++ b/recipes/mattiasgustavsson-libs/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" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self.settings): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") From 0bdeaf53ede9fa5e3f1cfbe96c47b4d5803372fe Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Thu, 29 Jun 2023 16:22:43 +0200 Subject: [PATCH 51/59] (#17995) fontconfig: migrate to util-linux-libuuid To avoid conflict with system libuuid --- recipes/fontconfig/meson/conanfile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/fontconfig/meson/conanfile.py b/recipes/fontconfig/meson/conanfile.py index 7effda31e1c9d..54997946cfcf6 100644 --- a/recipes/fontconfig/meson/conanfile.py +++ b/recipes/fontconfig/meson/conanfile.py @@ -52,11 +52,11 @@ def requirements(self): self.requires("freetype/2.13.0") self.requires("expat/2.5.0") if self.settings.os == "Linux": - self.requires("libuuid/1.0.3") + self.requires("util-linux-libuuid/2.39") def build_requirements(self): self.tool_requires("gperf/3.1") - self.tool_requires("meson/1.0.1") + self.tool_requires("meson/1.1.1") if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): self.tool_requires("pkgconf/1.9.3") From 5212b5e9c447f448c8d6aa72eea22bf5e6187dd8 Mon Sep 17 00:00:00 2001 From: toge Date: Thu, 29 Jun 2023 23:41:47 +0900 Subject: [PATCH 52/59] (#18136) zlib-ng: add version 2.1.3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Rubén Rincón Blanco --- recipes/zlib-ng/all/conandata.yml | 3 +++ recipes/zlib-ng/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/zlib-ng/all/conandata.yml b/recipes/zlib-ng/all/conandata.yml index 6a968e1b5df2d..27e5a03a3afe2 100644 --- a/recipes/zlib-ng/all/conandata.yml +++ b/recipes/zlib-ng/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.1.3": + url: "https://github.com/zlib-ng/zlib-ng/archive/refs/tags/2.1.3.tar.gz" + sha256: "d20e55f89d71991c59f1c5ad1ef944815e5850526c0d9cd8e504eaed5b24491a" "2.1.2": url: "https://github.com/zlib-ng/zlib-ng/archive/refs/tags/2.1.2.tar.gz" sha256: "383560d6b00697c04e8878e26c0187b480971a8bce90ffd26a5a7b0f7ecf1a33" diff --git a/recipes/zlib-ng/config.yml b/recipes/zlib-ng/config.yml index c37d0e56fedc6..96567d37e1ee8 100644 --- a/recipes/zlib-ng/config.yml +++ b/recipes/zlib-ng/config.yml @@ -1,4 +1,6 @@ versions: + "2.1.3": + folder: all "2.1.2": folder: all "2.0.7": From e2e3d104349524291260a4948e4ab228c07a34f3 Mon Sep 17 00:00:00 2001 From: Holger Detering Date: Thu, 29 Jun 2023 17:01:55 +0200 Subject: [PATCH 53/59] (#18142) cppcmd: conan v2 support --- recipes/cppcmd/all/conanfile.py | 78 ++++++++++--------- .../cppcmd/all/test_package/CMakeLists.txt | 9 +-- recipes/cppcmd/all/test_package/conanfile.py | 21 +++-- recipes/cppcmd/all/test_package/main.cpp | 2 + 4 files changed, 63 insertions(+), 47 deletions(-) diff --git a/recipes/cppcmd/all/conanfile.py b/recipes/cppcmd/all/conanfile.py index f83b9294d4efa..8e60072bb9375 100644 --- a/recipes/cppcmd/all/conanfile.py +++ b/recipes/cppcmd/all/conanfile.py @@ -1,7 +1,13 @@ +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.scm import Version +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout import os -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration -from glob import glob + + +required_conan_version = ">=1.52.0" class CppCmdConan(ConanFile): @@ -11,57 +17,57 @@ class CppCmdConan(ConanFile): homepage = "https://github.com/remysalim/cppcmd" url = "https://github.com/conan-io/conan-center-index" license = "MIT" + package_type = "header-library" settings = "os", "compiler", "arch", "build_type" - generators = "cmake" no_copy_source = True @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _build_subfolder(self): - return "build_subfolder" - - @property - def _minimum_cpp_standard(self): + def _min_cppstd(self): return 17 @property - def _minimum_compilers_version(self): + def _compilers_minimum_version(self): return { "Visual Studio": "15.7", + "msvc": "192", "gcc": "8", "clang": "7", "apple-clang": "10.2", } - def configure(self): - if self.settings.get_safe("compiler.cppstd"): - tools.check_min_cppstd(self, self._minimum_cpp_standard) - min_version = self._minimum_compilers_version.get( - str(self.settings.compiler)) - if not min_version: - self.output.warn("{} recipe lacks information about the {} compiler support.".format( - self.name, self.settings.compiler)) - else: - if tools.Version(self.settings.compiler.version) < min_version: - raise ConanInvalidConfiguration("{} requires C++17 support. The current compiler {} {} does not support it.".format( - self.name, self.settings.compiler, self.settings.compiler.version)) + def layout(self): + cmake_layout(self, src_folder="src") + + 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 package_id(self): + self.info.clear() def source(self): - tools.get(**self.conan_data["sources"][self.version]) - extracted_dir = glob("cppcmd-*")[0] - os.rename(extracted_dir, self._source_subfolder) + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_TESTS"] = False + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + # header_only - no build def package(self): - self.copy(pattern="LICENSE", dst="licenses", - src=self._source_subfolder) + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) cmake = CMake(self) - cmake.definitions["BUILD_TESTS"] = "OFF" - cmake.configure(source_folder=self._source_subfolder, - build_folder=self._build_subfolder) cmake.install() - def package_id(self): - self.info.header_only() + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/cppcmd/all/test_package/CMakeLists.txt b/recipes/cppcmd/all/test_package/CMakeLists.txt index 1ecd7e0a81c7b..9c5302dc6f47d 100644 --- a/recipes/cppcmd/all/test_package/CMakeLists.txt +++ b/recipes/cppcmd/all/test_package/CMakeLists.txt @@ -1,9 +1,8 @@ -cmake_minimum_required(VERSION 3.5) -project(test_package) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(cppcmd REQUIRED CONFIG) add_executable(${PROJECT_NAME} main.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} cppcmd::cppcmd) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/cppcmd/all/test_package/conanfile.py b/recipes/cppcmd/all/test_package/conanfile.py index bd7165a553cf4..3a91c9439218e 100644 --- a/recipes/cppcmd/all/test_package/conanfile.py +++ b/recipes/cppcmd/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.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/cppcmd/all/test_package/main.cpp b/recipes/cppcmd/all/test_package/main.cpp index 186e15bf7de57..94c409d3743fc 100644 --- a/recipes/cppcmd/all/test_package/main.cpp +++ b/recipes/cppcmd/all/test_package/main.cpp @@ -1,5 +1,7 @@ #include +#include +#include #include using namespace cppcmd; From 50da949ea16a96d2dd08aab74ec9a49bf6158404 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Thu, 29 Jun 2023 16:43:47 +0100 Subject: [PATCH 54/59] (#18123) croncpp: migrate to Conan v2 * croncpp: migrate to Conan v2 * croncpp: fix license copying --- recipes/croncpp/all/CMakeLists.txt | 9 ---- recipes/croncpp/all/conanfile.py | 50 ++++++++++++------- .../croncpp/all/test_package/CMakeLists.txt | 5 +- recipes/croncpp/all/test_package/conanfile.py | 22 +++++--- 4 files changed, 48 insertions(+), 38 deletions(-) delete mode 100644 recipes/croncpp/all/CMakeLists.txt diff --git a/recipes/croncpp/all/CMakeLists.txt b/recipes/croncpp/all/CMakeLists.txt deleted file mode 100644 index 46247ce0c956e..0000000000000 --- a/recipes/croncpp/all/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(conan_wrapper CXX) - -include(conanbuildinfo.cmake) -conan_basic_setup() - -set(CMAKE_CXX_STANDARD 11) - -add_subdirectory(source_subfolder) diff --git a/recipes/croncpp/all/conanfile.py b/recipes/croncpp/all/conanfile.py index cecf595a5a249..ffab100ea6a29 100644 --- a/recipes/croncpp/all/conanfile.py +++ b/recipes/croncpp/all/conanfile.py @@ -1,45 +1,57 @@ import os -import functools -from conans import ConanFile, CMake, tools -required_conan_version = ">=1.33.0" +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, rmdir + +required_conan_version = ">=1.52.0" + class CroncppConan(ConanFile): name = "croncpp" description = "A C++11/14/17 header-only cross-platform library for handling CRON expressions" - topics = ("cron", "header-only") license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/mariusbancila/croncpp/" + topics = ("cron", "header-only") + + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" - generators = "cmake", + no_copy_source = True @property - def _source_subfolder(self): - return "source_subfolder" + def _min_cppstd(self): + return 11 - def export_sources(self): - self.copy("CMakeLists.txt") + def layout(self): + cmake_layout(self, src_folder="src") def package_id(self): - self.info.header_only() + self.info.clear() def validate(self): if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, "11") + check_min_cppstd(self, self._min_cppstd) 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): + tc = CMakeToolchain(self) + tc.generate() - @functools.lru_cache(1) - def _configure_cmake(self): + def build(self): cmake = CMake(self) cmake.configure() - return cmake + cmake.build() def package(self): - self.copy("LICENSE*", "licenses", self._source_subfolder) - cmake = self._configure_cmake() + copy(self, "LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) cmake.install() - tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/croncpp/all/test_package/CMakeLists.txt b/recipes/croncpp/all/test_package/CMakeLists.txt index 1bb4c146bf257..0377a66e57597 100644 --- a/recipes/croncpp/all/test_package/CMakeLists.txt +++ b/recipes/croncpp/all/test_package/CMakeLists.txt @@ -1,9 +1,6 @@ -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.15) project(test_package CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - find_package(croncpp REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) diff --git a/recipes/croncpp/all/test_package/conanfile.py b/recipes/croncpp/all/test_package/conanfile.py index 6cae150e6701a..fae501d0afb9e 100644 --- a/recipes/croncpp/all/test_package/conanfile.py +++ b/recipes/croncpp/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 CroncppConan(ConanFile): + +class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + generators = "CMakeDeps", "CMakeToolchain" + 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") From 724676dd4086cc679ef3b0442c77868dc99133e2 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Thu, 29 Jun 2023 17:02:11 +0100 Subject: [PATCH 55/59] (#18119) debug_assert: migrate to Conan v2 * debug_assert: migrate to Conan v2 * debug_assert: fix misplaced min cppstd check --------- Co-authored-by: Carlos Zoido --- recipes/debug_assert/all/conanfile.py | 63 ++++++++++++------- .../all/test_package/CMakeLists.txt | 9 ++- .../all/test_package/conanfile.py | 21 +++++-- 3 files changed, 58 insertions(+), 35 deletions(-) diff --git a/recipes/debug_assert/all/conanfile.py b/recipes/debug_assert/all/conanfile.py index 7c5ec7a1005be..6ffe03cd97e25 100644 --- a/recipes/debug_assert/all/conanfile.py +++ b/recipes/debug_assert/all/conanfile.py @@ -1,35 +1,50 @@ -from conans import ConanFile, tools import os -class DebugAssert(ConanFile): - name = 'debug_assert' - description = 'Simple, flexible and modular assertion macro' - url = 'https://github.com/conan-io/conan-center-index' - homepage = 'http://foonathan.net/blog/2016/09/16/assertions.html' - license = 'Zlib' - topics = 'conan', 'assert', 'debugging', 'utilities' +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 + +required_conan_version = ">=1.52.0" - settings = 'compiler' +class DebugAssert(ConanFile): + name = "debug_assert" + description = "Simple, flexible and modular assertion macro" + license = "Zlib" + url = "https://github.com/conan-io/conan-center-index" + homepage = "http://foonathan.net/blog/2016/09/16/assertions.html" + topics = ("assert", "debugging", "utilities", "header-only") + + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" no_copy_source = True - _source_subfolder = 'source_subfolder' @property - def _repo_folder(self): - return os.path.join(self.source_folder, self._source_subfolder) + def _min_cppstd(self): + return 11 - def source(self): - tools.get(**self.conan_data["sources"][self.version]) - extracted_dir = self.name + "-" + self.version - os.rename(extracted_dir, self._source_subfolder) + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() - def configure(self): - if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, '11') + def validate(self): + if self.settings.get_safe("compiler.cppstd"): + check_min_cppstd(self, self._min_cppstd) - def package(self): - self.copy("*LICENSE", dst="licenses", keep_path=False) - self.copy("debug_assert.hpp", src=self._repo_folder, dst='include/') + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) - def package_id(self): - self.info.header_only() + def package(self): + copy(self, "*LICENSE", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder, keep_path=False) + copy(self, "debug_assert.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 = [] diff --git a/recipes/debug_assert/all/test_package/CMakeLists.txt b/recipes/debug_assert/all/test_package/CMakeLists.txt index 33ae887aa6aea..57219dd9b2fc5 100644 --- a/recipes/debug_assert/all/test_package/CMakeLists.txt +++ b/recipes/debug_assert/all/test_package/CMakeLists.txt @@ -1,9 +1,8 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(debug_assert REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE debug_assert::debug_assert) set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/debug_assert/all/test_package/conanfile.py b/recipes/debug_assert/all/test_package/conanfile.py index bd7165a553cf4..fae501d0afb9e 100644 --- a/recipes/debug_assert/all/test_package/conanfile.py +++ b/recipes/debug_assert/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" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self.settings): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") From 7a6161ceb6179eb80e59425f569aaae9a27004e2 Mon Sep 17 00:00:00 2001 From: Maxim Pimenov <10366009+mpimenov@users.noreply.github.com> Date: Thu, 29 Jun 2023 19:25:14 +0300 Subject: [PATCH 56/59] (#17691) arrow: fix the library name for the libacero component I think we got this part wrong in https://github.com/conan-io/conan-center-index/pull/17540 It's not clear if this name stays (see https://github.com/apache/arrow/issues/15280) but currently the file being created is libarrow_acero.a I'm not certain what to do with names of other components, such as pkg_config: for arrow_substrait we prepend "arrow_" everywhere, for "arrow_flight_sql" we do not. I've chosen to make the smallest possible diff that I am sure about. Co-authored-by: James --- 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 ee4cdd21e5b52..50780c591a6e7 100644 --- a/recipes/arrow/all/conanfile.py +++ b/recipes/arrow/all/conanfile.py @@ -575,7 +575,7 @@ def package_info(self): del self.options.plasma if self.options.acero: - self.cpp_info.components["libacero"].libs = [f"acero{suffix}"] + self.cpp_info.components["libacero"].libs = [f"arrow_acero{suffix}"] self.cpp_info.components["libacero"].names["cmake_find_package"] = "acero" self.cpp_info.components["libacero"].names["cmake_find_package_multi"] = "acero" self.cpp_info.components["libacero"].names["pkg_config"] = "acero" From e23cb169375cb079a5bc1553f3ab18e141d6e390 Mon Sep 17 00:00:00 2001 From: Roberto Rossini <71787608+robomics@users.noreply.github.com> Date: Thu, 29 Jun 2023 19:21:37 +0200 Subject: [PATCH 57/59] (#18146) libbigwig: bump deps --- recipes/libbigwig/all/conanfile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/libbigwig/all/conanfile.py b/recipes/libbigwig/all/conanfile.py index 0f28a5364da62..cf0ba30f73906 100644 --- a/recipes/libbigwig/all/conanfile.py +++ b/recipes/libbigwig/all/conanfile.py @@ -45,9 +45,9 @@ def requirements(self): if self.options.with_curl: # transitive_headers=True is required due to includes in bigWigIO.h # https://github.com/dpryan79/libBigWig/blob/master/bigWigIO.h#L5 - self.requires("libcurl/8.0.1", transitive_headers=True) + self.requires("libcurl/8.1.2", transitive_headers=True) if self.options.with_zlibng: - self.requires("zlib-ng/2.0.7") + self.requires("zlib-ng/2.1.3") else: self.requires("zlib/1.2.13") From d9de202b50396709fc85cab764a79a7e2f35b91d Mon Sep 17 00:00:00 2001 From: FireWolf <10460478+0xFireWolf@users.noreply.github.com> Date: Thu, 29 Jun 2023 13:41:38 -0700 Subject: [PATCH 58/59] (#18150) libunwind: Add version 1.7.0. --- recipes/libunwind/all/conandata.yml | 3 +++ recipes/libunwind/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/libunwind/all/conandata.yml b/recipes/libunwind/all/conandata.yml index 3379c640096e5..933dd5e18e6e0 100644 --- a/recipes/libunwind/all/conandata.yml +++ b/recipes/libunwind/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.7.0": + url: "https://github.com/libunwind/libunwind/releases/download/v1.7.0/libunwind-1.70.tar.gz" + sha256: "c24c913d2337d6eff851b6ab32aadfb683a86fee48d28fe1fc9cd56c8e9dfa58" "1.6.2": url: "https://github.com/libunwind/libunwind/releases/download/v1.6.2/libunwind-1.6.2.tar.gz" sha256: "4a6aec666991fb45d0889c44aede8ad6eb108071c3554fcdff671f9c94794976" diff --git a/recipes/libunwind/config.yml b/recipes/libunwind/config.yml index 26cf6b32aa2bf..06062bdf41682 100644 --- a/recipes/libunwind/config.yml +++ b/recipes/libunwind/config.yml @@ -1,4 +1,6 @@ versions: + "1.7.0": + folder: all "1.6.2": folder: all "1.5.0": From 64a30a53d55111074ae2151bf83635802f75eedb Mon Sep 17 00:00:00 2001 From: toge Date: Fri, 30 Jun 2023 17:22:38 +0900 Subject: [PATCH 59/59] (#18145) tinygltf: add version 2.8.13, update dependencies * tinygltf: add version 2.8.13 * add package_type --- recipes/tinygltf/all/conandata.yml | 3 +++ recipes/tinygltf/all/conanfile.py | 13 ++++++------- recipes/tinygltf/config.yml | 2 ++ 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/recipes/tinygltf/all/conandata.yml b/recipes/tinygltf/all/conandata.yml index 0e07d04c2de59..ecf335230f785 100644 --- a/recipes/tinygltf/all/conandata.yml +++ b/recipes/tinygltf/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.8.13": + url: "https://github.com/syoyo/tinygltf/archive/v2.8.13.tar.gz" + sha256: "72c3e5affa8389442582e4cf67426376e2dff418e998e19822260f4bf58b74b8" "2.5.0": url: "https://github.com/syoyo/tinygltf/archive/v2.5.0.tar.gz" sha256: "5d85bd556b60b1b69527189293cfa4902957d67fabb8582b6532f23a5ef27ec1" diff --git a/recipes/tinygltf/all/conanfile.py b/recipes/tinygltf/all/conanfile.py index 1d6e2279c2680..4f9e36874366d 100644 --- a/recipes/tinygltf/all/conanfile.py +++ b/recipes/tinygltf/all/conanfile.py @@ -11,10 +11,10 @@ class TinygltfConan(ConanFile): name = "tinygltf" description = "Header only C++11 tiny glTF 2.0 library." license = "MIT" - topics = ("gltf") - homepage = "https://github.com/syoyo/tinygltf" url = "https://github.com/conan-io/conan-center-index" - + homepage = "https://github.com/syoyo/tinygltf" + topics = ("gltf", "header-only") + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" options = { "draco": [True, False], @@ -36,17 +36,16 @@ def package_id(self): def requirements(self): self.requires("nlohmann_json/3.11.2") if self.options.draco: - self.requires("draco/1.5.5") + self.requires("draco/1.5.6") if self.options.stb_image or self.options.stb_image_write: - self.requires("stb/cci.20210910") + self.requires("stb/cci.20220909") def validate(self): if self.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, 11) def source(self): - get(self, **self.conan_data["sources"][self.version], - destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def build(self): replace_in_file(self, os.path.join(self.source_folder, "tiny_gltf.h"), diff --git a/recipes/tinygltf/config.yml b/recipes/tinygltf/config.yml index a23d2b23eb439..b8d9dd2cb9e3a 100644 --- a/recipes/tinygltf/config.yml +++ b/recipes/tinygltf/config.yml @@ -1,4 +1,6 @@ versions: + "2.8.13": + folder: all "2.5.0": folder: all "2.4.0":