From 2f25d6a7735d0135cf91020c443a1297a953eafb Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Fri, 28 Apr 2023 10:55:18 +0200 Subject: [PATCH 01/34] (#17088) paho-mqtt-c: bump openssl + drop maintenance of 1.3.0 & 1.3.1 * bump openssl * drop maintenance of 1.3.0 & 1.3.1 * add anl to system libs if Linux * use version range for openssl --- recipes/paho-mqtt-c/all/conandata.yml | 20 --- recipes/paho-mqtt-c/all/conanfile.py | 46 ++--- ...1-fix-MinGW-and-OSX-builds-for-1-3-0.patch | 169 ------------------ ...2-fix-MinGW-and-OSX-builds-for-1-3-1.patch | 169 ------------------ .../patches/0004-fix-cmake-find-openssl.patch | 47 ----- recipes/paho-mqtt-c/config.yml | 4 - 6 files changed, 16 insertions(+), 439 deletions(-) delete mode 100644 recipes/paho-mqtt-c/all/patches/0001-fix-MinGW-and-OSX-builds-for-1-3-0.patch delete mode 100644 recipes/paho-mqtt-c/all/patches/0002-fix-MinGW-and-OSX-builds-for-1-3-1.patch delete mode 100644 recipes/paho-mqtt-c/all/patches/0004-fix-cmake-find-openssl.patch diff --git a/recipes/paho-mqtt-c/all/conandata.yml b/recipes/paho-mqtt-c/all/conandata.yml index 3cbc11b2a30de..97257e57f3eab 100644 --- a/recipes/paho-mqtt-c/all/conandata.yml +++ b/recipes/paho-mqtt-c/all/conandata.yml @@ -23,12 +23,6 @@ sources: "1.3.4": url: "https://github.com/eclipse/paho.mqtt.c/archive/v1.3.4.tar.gz" sha256: "1ae9b657b693254ed0710350df3dcf5232d1f479409a52861b5e5bb5cc3da046" - "1.3.1": - url: "https://github.com/eclipse/paho.mqtt.c/archive/v1.3.1.tar.gz" - sha256: "7b4eed66ae3df3613629139c0df28b16abfa4e0927bd17360027d936784aa55e" - "1.3.0": - url: "https://github.com/eclipse/paho.mqtt.c/archive/v1.3.0.tar.gz" - sha256: "87cf846b02dde6328b84832287d8725d91f12f41366eecb4d59eeda1d6c7efdf" patches: "1.3.9": - patch_file: "patches/0003-allow-static-windows-runtimes.patch" @@ -50,17 +44,3 @@ patches: - patch_file: "patches/0002-fix-MinGW-and-OSX-builds-for-1-3-4.patch" patch_description: "disable cpack, link win32 libs more, source patches for MinGW/OSX" patch_type: "conan" - "1.3.1": - - patch_file: "patches/0002-fix-MinGW-and-OSX-builds-for-1-3-1.patch" - patch_description: "disable cpack, link win32 libs more, source patches for MinGW/OSX" - patch_type: "conan" - - patch_file: "patches/0004-fix-cmake-find-openssl.patch" - patch_description: "use cci openssl" - patch_type: "conan" - "1.3.0": - - patch_file: "patches/0001-fix-MinGW-and-OSX-builds-for-1-3-0.patch" - patch_description: "disable cpack, link win32 libs more, source patches for MinGW/OSX" - patch_type: "conan" - - patch_file: "patches/0004-fix-cmake-find-openssl.patch" - patch_description: "use cci openssl" - patch_type: "conan" diff --git a/recipes/paho-mqtt-c/all/conanfile.py b/recipes/paho-mqtt-c/all/conanfile.py index 5979cabf16f7d..7af37a8f2229f 100644 --- a/recipes/paho-mqtt-c/all/conanfile.py +++ b/recipes/paho-mqtt-c/all/conanfile.py @@ -1,12 +1,11 @@ from conan import ConanFile -from conan.errors import ConanInvalidConfiguration -from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rm, replace_in_file -from conan.tools.scm import Version from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rm, replace_in_file import os required_conan_version = ">=1.53.0" + class PahoMqttcConan(ConanFile): name = "paho-mqtt-c" description = "Eclipse Paho MQTT C client library for Linux, Windows and MacOS" @@ -31,10 +30,6 @@ class PahoMqttcConan(ConanFile): "high_performance": False, } - @property - def _has_high_performance_option(self): - return Version(self.version) >= "1.3.2" - def export_sources(self): export_conandata_patches(self) @@ -42,9 +37,6 @@ def config_options(self): if self.settings.os == "Windows": del self.options.fPIC - if not self._has_high_performance_option: - del self.options.high_performance - def configure(self): if self.options.shared: self.options.rm_safe("fPIC") @@ -57,11 +49,7 @@ def layout(self): def requirements(self): if self.options.ssl: # Headers are exposed https://github.com/eclipse/paho.mqtt.c/blob/f7799da95e347bbc930b201b52a1173ebbad45a7/src/SSLSocket.h#L29 - self.requires("openssl/1.1.1t", transitive_headers=True) - - def validate(self): - if not self.options.shared and Version(self.version) < "1.3.4": - raise ConanInvalidConfiguration(f"{self.ref} does not support static linking") + self.requires("openssl/[>=1.1 <4]", transitive_headers=True) def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -80,8 +68,7 @@ def generate(self): if self.options.ssl: tc.cache_variables["OPENSSL_SEARCH_PATH"] = self.dependencies["openssl"].package_folder.replace("\\", "/") tc.cache_variables["OPENSSL_ROOT_DIR"] = self.dependencies["openssl"].package_folder.replace("\\", "/") - if self._has_high_performance_option: - tc.variables["PAHO_HIGH_PERFORMANCE"] = self.options.high_performance + tc.variables["PAHO_HIGH_PERFORMANCE"] = self.options.high_performance tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" tc.generate() @@ -119,27 +106,25 @@ def package(self): rm(self, "*.cmake", os.path.join(self.package_folder, "lib")) def package_info(self): - self.cpp_info.components["_paho-mqtt-c"].libs = [self._lib_target] - self.cpp_info.set_property("cmake_file_name", "eclipse-paho-mqtt-c") + self.cpp_info.set_property("cmake_target_name", f"eclipse-paho-mqtt-c::{self._cmake_target}") - self.cpp_info.components["_paho-mqtt-c"].set_property("cmake_target_name", f"eclipse-paho-mqtt-c::{self._cmake_target}") - + # TODO: back to global scope in conan v2 + self.cpp_info.components["_paho-mqtt-c"].libs = [self._lib_target] if self.settings.os == "Windows": if not self.options.shared: self.cpp_info.components["_paho-mqtt-c"].system_libs.append("ws2_32") if self.settings.compiler == "gcc": self.cpp_info.components["_paho-mqtt-c"].system_libs.extend( ["wsock32", "uuid", "crypt32", "rpcrt4"]) + elif self.settings.os == "Linux": + self.cpp_info.components["_paho-mqtt-c"].system_libs.extend(["anl", "c", "dl", "pthread"]) + elif self.settings.os == "FreeBSD": + self.cpp_info.components["_paho-mqtt-c"].system_libs.extend(["compat", "pthread"]) + elif self.settings.os == "Android": + self.cpp_info.components["_paho-mqtt-c"].system_libs.extend(["c"]) else: - if self.settings.os == "Linux": - self.cpp_info.components["_paho-mqtt-c"].system_libs.extend(["c", "dl", "pthread"]) - elif self.settings.os == "FreeBSD": - self.cpp_info.components["_paho-mqtt-c"].system_libs.extend(["compat", "pthread"]) - elif self.settings.os == "Android": - self.cpp_info.components["_paho-mqtt-c"].system_libs.extend(["c"]) - else: - self.cpp_info.components["_paho-mqtt-c"].system_libs.extend(["c", "pthread"]) + self.cpp_info.components["_paho-mqtt-c"].system_libs.extend(["c", "pthread"]) if self.options.ssl: self.cpp_info.components["_paho-mqtt-c"].requires = ["openssl::openssl"] @@ -149,6 +134,7 @@ def package_info(self): self.cpp_info.names["cmake_find_package_multi"] = "eclipse-paho-mqtt-c" self.cpp_info.components["_paho-mqtt-c"].names["cmake_find_package"] = self._cmake_target self.cpp_info.components["_paho-mqtt-c"].names["cmake_find_package_multi"] = self._cmake_target + self.cpp_info.components["_paho-mqtt-c"].set_property("cmake_target_name", f"eclipse-paho-mqtt-c::{self._cmake_target}") @property def _epl_file(self): @@ -172,6 +158,6 @@ def _lib_target(self): target += "s" if not self.options.shared: # https://github.com/eclipse/paho.mqtt.c/blob/317fb008e1541838d1c29076d2bc5c3e4b6c4f53/src/CMakeLists.txt#L154 - if Version(self.version) < "1.3.2" or self.settings.os == "Windows": + if self.settings.os == "Windows": target += "-static" return target diff --git a/recipes/paho-mqtt-c/all/patches/0001-fix-MinGW-and-OSX-builds-for-1-3-0.patch b/recipes/paho-mqtt-c/all/patches/0001-fix-MinGW-and-OSX-builds-for-1-3-0.patch deleted file mode 100644 index 8b2cf63dd0649..0000000000000 --- a/recipes/paho-mqtt-c/all/patches/0001-fix-MinGW-and-OSX-builds-for-1-3-0.patch +++ /dev/null @@ -1,169 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index b53745b..d8787d8 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -37,7 +37,7 @@ STRING(TIMESTAMP BUILD_TIMESTAMP UTC) - MESSAGE(STATUS "Timestamp is ${BUILD_TIMESTAMP}") - - IF(WIN32) -- ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE -DWIN32_LEAN_AND_MEAN -MD) -+ ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE -DWIN32_LEAN_AND_MEAN) - ELSEIF(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") - ADD_DEFINITIONS(-DOSX) - ENDIF() -@@ -61,34 +61,6 @@ IF(PAHO_BUILD_DOCUMENTATION) - ADD_SUBDIRECTORY(doc) - ENDIF() - --IF (PAHO_ENABLE_CPACK) -- ### packaging settings -- FILE(GLOB samples "src/samples/*.c") -- INSTALL(FILES ${samples} DESTINATION samples) -- -- SET(CPACK_PACKAGE_VENDOR "Eclipse Paho") -- SET(CPACK_PACKAGE_NAME "Eclipse-Paho-MQTT-C") -- INSTALL(FILES CONTRIBUTING.md epl-v10 edl-v10 README.md notice.html DESTINATION .) -- -- IF (WIN32) -- SET(CPACK_GENERATOR "ZIP") -- ELSEIF(PAHO_BUILD_DEB_PACKAGE) -- INSTALL(FILES CONTRIBUTING.md epl-v10 edl-v10 README.md notice.html DESTINATION .) -- -- SET(CPACK_GENERATOR "DEB") -- CONFIGURE_FILE(${CMAKE_SCRIPTS}/CPackDebConfig.cmake.in -- ${CMAKE_BINARY_DIR}/CPackDebConfig.cmake @ONLY) -- SET(CPACK_PROJECT_CONFIG_FILE ${CMAKE_BINARY_DIR}/CPackDebConfig.cmake) -- ADD_SUBDIRECTORY(debian) -- ELSE() -- SET(CPACK_GENERATOR "TGZ") -- ENDIF() --ELSE() -- FILE(GLOB samples "src/samples/*.c") -- INSTALL(FILES ${samples} DESTINATION ${CMAKE_INSTALL_DOCDIR}) -- --ENDIF() -- - SET(CPACK_PACKAGE_VERSION_MAJOR ${PAHO_VERSION_MAJOR}) - SET(CPACK_PACKAGE_VERSION_MINOR ${PAHO_VERSION_MINOR}) - SET(CPACK_PACKAGE_VERSION_PATCH ${PAHO_VERSION_PATCH}) -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index b46eaca..399b37d 100644 ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -55,7 +55,7 @@ SET(common_src - ) - - IF (WIN32) -- SET(LIBS_SYSTEM ws2_32) -+ SET(LIBS_SYSTEM ws2_32 rpcrt4 crypt32 wsock32) - ELSEIF (UNIX) - IF(CMAKE_SYSTEM_NAME MATCHES "Linux") - SET(LIBS_SYSTEM c dl pthread) -diff --git a/src/MQTTAsync.c b/src/MQTTAsync.c -index a5813b4..4f209ec 100644 ---- a/src/MQTTAsync.c -+++ b/src/MQTTAsync.c -@@ -205,6 +205,14 @@ START_TIME_TYPE MQTTAsync_start_clock(void) - clock_gettime(CLOCK_MONOTONIC, &start); - return start; - } -+#elif defined(__APPLE__) && __MAC_OS_X_VERSION_MIN_REQUIRED < 101200 -+#define START_TIME_TYPE struct timeval -+START_TIME_TYPE MQTTAsync_start_clock(void) -+{ -+ static struct timeval start; -+ gettimeofday(&start, NULL); -+ return start; -+} - #else - #define START_TIME_TYPE struct timeval - START_TIME_TYPE MQTTAsync_start_clock(void) -@@ -235,6 +243,16 @@ long MQTTAsync_elapsed(struct timespec start) - ntimersub(now, start, res); - return (res.tv_sec)*1000L + (res.tv_nsec)/1000000L; - } -+#elif defined(__APPLE__) && __MAC_OS_X_VERSION_MIN_REQUIRED < 101200 -+ -+long MQTTAsync_elapsed(struct timeval start) -+{ -+ struct timeval now, res; -+ -+ gettimeofday(&now, NULL); -+ timersub(&now, &start, &res); -+ return (res.tv_sec)*1000 + (res.tv_usec)/1000; -+} - #else - long MQTTAsync_elapsed(struct timeval start) - { -diff --git a/src/MQTTClient.c b/src/MQTTClient.c -index 2069ff9..faee1ae 100644 ---- a/src/MQTTClient.c -+++ b/src/MQTTClient.c -@@ -258,6 +258,14 @@ START_TIME_TYPE MQTTClient_start_clock(void) - clock_gettime(CLOCK_MONOTONIC, &start); - return start; - } -+#elif defined(__APPLE__) && __MAC_OS_X_VERSION_MIN_REQUIRED < 101200 -+#define START_TIME_TYPE struct timeval -+START_TIME_TYPE MQTTClient_start_clock(void) -+{ -+ static struct timeval start; -+ gettimeofday(&start, NULL); -+ return start; -+} - #else - #define START_TIME_TYPE struct timeval - START_TIME_TYPE MQTTClient_start_clock(void) -@@ -288,6 +296,15 @@ long MQTTClient_elapsed(struct timespec start) - ntimersub(now, start, res); - return (res.tv_sec)*1000L + (res.tv_nsec)/1000000L; - } -+#elif defined(__APPLE__) && __MAC_OS_X_VERSION_MIN_REQUIRED < 101200 -+long MQTTClient_elapsed(struct timeval start) -+{ -+ struct timeval now, res; -+ -+ gettimeofday(&now, NULL); -+ timersub(&now, &start, &res); -+ return (res.tv_sec)*1000 + (res.tv_usec)/1000; -+} - #else - long MQTTClient_elapsed(struct timeval start) - { -diff --git a/src/Thread.c b/src/Thread.c -index 4cb2f16..40ce8dc 100644 ---- a/src/Thread.c -+++ b/src/Thread.c -@@ -409,9 +409,16 @@ int Thread_wait_cond(cond_type condvar, int timeout) - struct timespec cond_timeout; - - FUNC_ENTRY; -+#if defined(__APPLE__) && __MAC_OS_X_VERSION_MIN_REQUIRED < 101200 -+ struct timeval cur_time; -+ gettimeofday(&cur_time, NULL); -+ cond_timeout.tv_sec = cur_time.tv_sec + timeout; -+ cond_timeout.tv_nsec = cur_time.tv_usec * 1000; -+#else - clock_gettime(CLOCK_REALTIME, &cond_timeout); - - cond_timeout.tv_sec += timeout; -+#endif - pthread_mutex_lock(&condvar->mutex); - rc = pthread_cond_timedwait(&condvar->cond, &condvar->mutex, &cond_timeout); - pthread_mutex_unlock(&condvar->mutex); -diff --git a/src/WebSocket.c b/src/WebSocket.c -index 47b1dad..3f96dac 100644 ---- a/src/WebSocket.c -+++ b/src/WebSocket.c -@@ -28,6 +28,11 @@ - #include "MQTTProtocolOut.h" - #include "StackTrace.h" - -+#ifdef __MINGW32__ -+#define htonll __builtin_bswap64 -+#define ntohll __builtin_bswap64 -+#endif -+ - #if defined(__linux__) - # include - #elif defined(__APPLE__) diff --git a/recipes/paho-mqtt-c/all/patches/0002-fix-MinGW-and-OSX-builds-for-1-3-1.patch b/recipes/paho-mqtt-c/all/patches/0002-fix-MinGW-and-OSX-builds-for-1-3-1.patch deleted file mode 100644 index 5ffa0a2a42da0..0000000000000 --- a/recipes/paho-mqtt-c/all/patches/0002-fix-MinGW-and-OSX-builds-for-1-3-1.patch +++ /dev/null @@ -1,169 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index b53745b..d8787d8 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -37,7 +37,7 @@ STRING(TIMESTAMP BUILD_TIMESTAMP UTC) - MESSAGE(STATUS "Timestamp is ${BUILD_TIMESTAMP}") - - IF(WIN32) -- ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE -DWIN32_LEAN_AND_MEAN -MD) -+ ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE -DWIN32_LEAN_AND_MEAN) - ELSEIF(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") - ADD_DEFINITIONS(-DOSX) - ENDIF() -@@ -61,34 +61,6 @@ IF(PAHO_BUILD_DOCUMENTATION) - ADD_SUBDIRECTORY(doc) - ENDIF() - --IF (PAHO_ENABLE_CPACK) -- ### packaging settings -- FILE(GLOB samples "src/samples/*.c") -- INSTALL(FILES ${samples} DESTINATION samples) -- -- SET(CPACK_PACKAGE_VENDOR "Eclipse Paho") -- SET(CPACK_PACKAGE_NAME "Eclipse-Paho-MQTT-C") -- INSTALL(FILES CONTRIBUTING.md epl-v10 edl-v10 README.md notice.html DESTINATION .) -- -- IF (WIN32) -- SET(CPACK_GENERATOR "ZIP") -- ELSEIF(PAHO_BUILD_DEB_PACKAGE) -- INSTALL(FILES CONTRIBUTING.md epl-v10 edl-v10 README.md notice.html DESTINATION .) -- -- SET(CPACK_GENERATOR "DEB") -- CONFIGURE_FILE(${CMAKE_SCRIPTS}/CPackDebConfig.cmake.in -- ${CMAKE_BINARY_DIR}/CPackDebConfig.cmake @ONLY) -- SET(CPACK_PROJECT_CONFIG_FILE ${CMAKE_BINARY_DIR}/CPackDebConfig.cmake) -- ADD_SUBDIRECTORY(debian) -- ELSE() -- SET(CPACK_GENERATOR "TGZ") -- ENDIF() --ELSE() -- FILE(GLOB samples "src/samples/*.c") -- INSTALL(FILES ${samples} DESTINATION ${CMAKE_INSTALL_DOCDIR}) -- --ENDIF() -- - SET(CPACK_PACKAGE_VERSION_MAJOR ${PAHO_VERSION_MAJOR}) - SET(CPACK_PACKAGE_VERSION_MINOR ${PAHO_VERSION_MINOR}) - SET(CPACK_PACKAGE_VERSION_PATCH ${PAHO_VERSION_PATCH}) -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index b46eaca..399b37d 100644 ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -55,7 +55,7 @@ SET(common_src - ) - - IF (WIN32) -- SET(LIBS_SYSTEM ws2_32) -+ SET(LIBS_SYSTEM ws2_32 rpcrt4 crypt32 wsock32) - ELSEIF (UNIX) - IF(CMAKE_SYSTEM_NAME MATCHES "Linux") - SET(LIBS_SYSTEM c dl pthread) -diff --git a/src/MQTTAsync.c b/src/MQTTAsync.c -index a5813b4..4f209ec 100644 ---- a/src/MQTTAsync.c -+++ b/src/MQTTAsync.c -@@ -205,6 +205,14 @@ START_TIME_TYPE MQTTAsync_start_clock(void) - clock_gettime(CLOCK_MONOTONIC, &start); - return start; - } -+#elif defined(__APPLE__) && __MAC_OS_X_VERSION_MIN_REQUIRED < 101200 -+#define START_TIME_TYPE struct timeval -+START_TIME_TYPE MQTTAsync_start_clock(void) -+{ -+ static struct timeval start; -+ gettimeofday(&start, NULL); -+ return start; -+} - #else - #define START_TIME_TYPE struct timeval - START_TIME_TYPE MQTTAsync_start_clock(void) -@@ -255,6 +263,16 @@ long MQTTAsync_elapsed(struct timespec start) - ntimersub(now, start, res); - return (res.tv_sec)*1000L + (res.tv_nsec)/1000000L; - } -+#elif defined(__APPLE__) && __MAC_OS_X_VERSION_MIN_REQUIRED < 101200 -+ -+long MQTTAsync_elapsed(struct timeval start) -+{ -+ struct timeval now, res; -+ -+ gettimeofday(&now, NULL); -+ timersub(&now, &start, &res); -+ return (res.tv_sec)*1000 + (res.tv_usec)/1000; -+} - #else - long MQTTAsync_elapsed(struct timeval start) - { -diff --git a/src/MQTTClient.c b/src/MQTTClient.c -index 2069ff9..faee1ae 100644 ---- a/src/MQTTClient.c -+++ b/src/MQTTClient.c -@@ -258,6 +258,14 @@ START_TIME_TYPE MQTTClient_start_clock(void) - clock_gettime(CLOCK_MONOTONIC, &start); - return start; - } -+#elif defined(__APPLE__) && __MAC_OS_X_VERSION_MIN_REQUIRED < 101200 -+#define START_TIME_TYPE struct timeval -+START_TIME_TYPE MQTTClient_start_clock(void) -+{ -+ static struct timeval start; -+ gettimeofday(&start, NULL); -+ return start; -+} - #else - #define START_TIME_TYPE struct timeval - START_TIME_TYPE MQTTClient_start_clock(void) -@@ -288,6 +296,15 @@ long MQTTClient_elapsed(struct timespec start) - ntimersub(now, start, res); - return (res.tv_sec)*1000L + (res.tv_nsec)/1000000L; - } -+#elif defined(__APPLE__) && __MAC_OS_X_VERSION_MIN_REQUIRED < 101200 -+long MQTTClient_elapsed(struct timeval start) -+{ -+ struct timeval now, res; -+ -+ gettimeofday(&now, NULL); -+ timersub(&now, &start, &res); -+ return (res.tv_sec)*1000 + (res.tv_usec)/1000; -+} - #else - long MQTTClient_elapsed(struct timeval start) - { -diff --git a/src/Thread.c b/src/Thread.c -index 4cb2f16..40ce8dc 100644 ---- a/src/Thread.c -+++ b/src/Thread.c -@@ -411,9 +411,16 @@ int Thread_wait_cond(cond_type condvar, int timeout) - struct timespec cond_timeout; - - FUNC_ENTRY; -+#if defined(__APPLE__) && __MAC_OS_X_VERSION_MIN_REQUIRED < 101200 -+ struct timeval cur_time; -+ gettimeofday(&cur_time, NULL); -+ cond_timeout.tv_sec = cur_time.tv_sec + timeout; -+ cond_timeout.tv_nsec = cur_time.tv_usec * 1000; -+#else - clock_gettime(CLOCK_REALTIME, &cond_timeout); - - cond_timeout.tv_sec += timeout; -+#endif - pthread_mutex_lock(&condvar->mutex); - rc = pthread_cond_timedwait(&condvar->cond, &condvar->mutex, &cond_timeout); - pthread_mutex_unlock(&condvar->mutex); -diff --git a/src/WebSocket.c b/src/WebSocket.c -index 47b1dad..3f96dac 100644 ---- a/src/WebSocket.c -+++ b/src/WebSocket.c -@@ -29,6 +28,11 @@ - #include "SocketBuffer.h" - #include "StackTrace.h" - -+#ifdef __MINGW32__ -+#define htonll __builtin_bswap64 -+#define ntohll __builtin_bswap64 -+#endif -+ - #if defined(__linux__) - # include - #elif defined(__APPLE__) diff --git a/recipes/paho-mqtt-c/all/patches/0004-fix-cmake-find-openssl.patch b/recipes/paho-mqtt-c/all/patches/0004-fix-cmake-find-openssl.patch deleted file mode 100644 index 54de70390b304..0000000000000 --- a/recipes/paho-mqtt-c/all/patches/0004-fix-cmake-find-openssl.patch +++ /dev/null @@ -1,47 +0,0 @@ -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index 399b37d..55fee4f 100644 ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -108,29 +108,10 @@ INSTALL(FILES MQTTAsync.h MQTTClient.h MQTTClientPersistence.h MQTTProperties.h - IF (PAHO_WITH_SSL) - SET(OPENSSL_SEARCH_PATH "" CACHE PATH "Directory containing OpenSSL libraries and includes") - -- IF (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") -- SET(OPENSSL_SEARCH_PATH "/usr/local/opt/openssl") -- ENDIF (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") -- -- IF (WIN32) -- SET(OPENSSL_SEARCH_PATH "C:/OpenSSL-Win64") -- SET(OPENSSL_SEARCH_LIB_PATH "${OPENSSL_SEARCH_PATH}/lib64") -- IF (DEFINED ENV{PAHO_WINDOWS_BUILD_BIT}) -- IF ($ENV{PAHO_WINDOWS_BUILD_BIT} STREQUAL "x86") -- SET(OPENSSL_SEARCH_PATH "C:/OpenSSL-Win32") -- SET(OPENSSL_SEARCH_LIB_PATH "${OPENSSL_SEARCH_PATH}/lib32") -- ENDIF () -- ENDIF () -- ELSE() -- SET(OPENSSL_SEARCH_LIB_PATH "${OPENSSL_SEARCH_PATH}/lib64") -- ENDIF () -- -- FIND_PATH(OPENSSL_INCLUDE_DIR openssl/ssl.h -- HINTS ${OPENSSL_SEARCH_PATH}/include) -- FIND_LIBRARY(OPENSSL_LIB NAMES ssl libssl ssleay32 -- HINTS ${OPENSSL_SEARCH_PATH}/lib ${OPENSSL_SEARCH_LIB_PATH}) -- FIND_LIBRARY(OPENSSLCRYPTO_LIB NAMES crypto libcrypto libeay32 -- HINTS ${OPENSSL_SEARCH_PATH}/lib ${OPENSSL_SEARCH_LIB_PATH}) -+ find_package(OpenSSL REQUIRED CONFIG) -+ -+ SET(OPENSSL_LIB ${OPENSSL_SSL_LIBRARY}) -+ SET(OPENSSLCRYPTO_LIB ${OPENSSL_CRYPTO_LIBRARY}) - - MESSAGE(STATUS "OpenSSL hints: ${OPENSSL_SEARCH_PATH}") - MESSAGE(STATUS "OpenSSL headers found at ${OPENSSL_INCLUDE_DIR}") -@@ -151,6 +132,8 @@ IF (PAHO_WITH_SSL) - - TARGET_LINK_LIBRARIES(paho-mqtt3cs ${OPENSSL_LIB} ${OPENSSLCRYPTO_LIB} ${LIBS_SYSTEM}) - TARGET_LINK_LIBRARIES(paho-mqtt3as ${OPENSSL_LIB} ${OPENSSLCRYPTO_LIB} ${LIBS_SYSTEM}) -+ target_link_directories(paho-mqtt3cs PRIVATE "${OPENSSL_ROOT_DIR}/lib") -+ target_link_directories(paho-mqtt3as PRIVATE "${OPENSSL_ROOT_DIR}/lib") - SET_TARGET_PROPERTIES( - paho-mqtt3cs paho-mqtt3as PROPERTIES - VERSION ${CLIENT_VERSION} diff --git a/recipes/paho-mqtt-c/config.yml b/recipes/paho-mqtt-c/config.yml index bb19e3738404a..7d5e8aea45866 100644 --- a/recipes/paho-mqtt-c/config.yml +++ b/recipes/paho-mqtt-c/config.yml @@ -15,7 +15,3 @@ versions: folder: "all" "1.3.4": folder: "all" - "1.3.1": - folder: "all" - "1.3.0": - folder: "all" From 5815ed963ba704dcae9aa7e94624ff2be16222b5 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Fri, 28 Apr 2023 15:32:30 +0200 Subject: [PATCH 02/34] (#17279) cppserver: use version range for openssl & bump asio --- recipes/cppserver/all/conanfile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/cppserver/all/conanfile.py b/recipes/cppserver/all/conanfile.py index 91e6f623b52d8..785bad0fb6e29 100644 --- a/recipes/cppserver/all/conanfile.py +++ b/recipes/cppserver/all/conanfile.py @@ -57,8 +57,8 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("asio/1.24.0") - self.requires("openssl/1.1.1s") + self.requires("asio/1.27.0") + self.requires("openssl/[>=1.1 <4]") self.requires("cppcommon/1.0.3.0") def validate(self): From 30f251ea17f37dacbbec239ade45e9f5ff469c2f Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Fri, 28 Apr 2023 16:23:26 +0200 Subject: [PATCH 03/34] (#17280) zlib: add mirror url for tarball of 1.2.13 --- recipes/zlib/all/conandata.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/recipes/zlib/all/conandata.yml b/recipes/zlib/all/conandata.yml index e2abd8cd4f339..4da75436b4d71 100644 --- a/recipes/zlib/all/conandata.yml +++ b/recipes/zlib/all/conandata.yml @@ -1,6 +1,8 @@ sources: "1.2.13": - url: "https://zlib.net/fossils/zlib-1.2.13.tar.gz" + url: + - "https://zlib.net/fossils/zlib-1.2.13.tar.gz" + - "https://github.com/madler/zlib/releases/download/v1.2.13/zlib-1.2.13.tar.gz" sha256: "b3a24de97a8fdbc835b9833169501030b8977031bcb54b3b3ac13740f846ab30" "1.2.12": url: "https://zlib.net/fossils/zlib-1.2.12.tar.gz" From f485b5732ed0f797c87f8b02a9147193ad7d895f Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Fri, 28 Apr 2023 07:42:42 -0700 Subject: [PATCH 04/34] (#17205) wavelet_buffer: remove cmake_new_enough --- recipes/wavelet_buffer/all/conanfile.py | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/recipes/wavelet_buffer/all/conanfile.py b/recipes/wavelet_buffer/all/conanfile.py index d2fc690c180b0..69a04b499e31b 100644 --- a/recipes/wavelet_buffer/all/conanfile.py +++ b/recipes/wavelet_buffer/all/conanfile.py @@ -17,7 +17,7 @@ class WaveletBufferConan(ConanFile): topics = ("compression", "signal-processing", "wavelet") homepage = "https://github.com/panda-official/WaveletBuffer" url = "https://github.com/conan-io/conan-center-index" - + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -80,24 +80,11 @@ def validate(self): if is_msvc(self) and self.options.shared: raise ConanInvalidConfiguration(f"{self.ref} can not be built as shared with Visual Studio.") - def _cmake_new_enough(self, required_version): - try: - import re - from io import StringIO - output = StringIO() - self.run("cmake --version", output=output) - m = re.search(r'cmake version (\d+\.\d+\.\d+)', output.getvalue()) - return Version(m.group(1)) >= required_version - except: - return False - def build_requirements(self): - if not self._cmake_new_enough("3.16"): - self.tool_requires("cmake/3.25.0") + self.tool_requires("cmake/[>=3.16 <4]") def source(self): - get(self, **self.conan_data["sources"][self.version], - destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): tc = CMakeToolchain(self) From fa2853d170a640559f173cc1a8faf862f1d7aaf2 Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Fri, 28 Apr 2023 08:07:36 -0700 Subject: [PATCH 05/34] (#17200) h3: drop cmake_new_enough MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * h3: drop cmake_new_enough uses https://github.com/conan-io/conan-center-index/pull/17192 instead * Update recipes/h3/all/conanfile.py --------- Co-authored-by: Rubén Rincón Blanco --- recipes/h3/all/conanfile.py | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/recipes/h3/all/conanfile.py b/recipes/h3/all/conanfile.py index 50c5d475b2fea..1976ac70237aa 100644 --- a/recipes/h3/all/conanfile.py +++ b/recipes/h3/all/conanfile.py @@ -46,20 +46,9 @@ def configure(self): def layout(self): cmake_layout(self, src_folder="src") - 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 Version(self.version) >= "4.1.0" and not self._cmake_new_enough("3.20"): - self.tool_requires("cmake/3.25.2") + if Version(self.version) >= "4.1.0": + self.tool_requires("cmake/[>=3.20 <4]") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) From fe0ea28798c38315ff0819c682fda8a034081f9b Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Fri, 28 Apr 2023 17:43:48 +0200 Subject: [PATCH 06/34] (#17098) gsoap: add package_type + bump openssl & bison * bump openssl & bison * add package_type * cleanup topics * openssl headers are public * fix test package * use winflexbison if build machine is Windows * minor change * test package workaround for conan v1 client * use version range for openssl --- recipes/gsoap/all/conanfile.py | 13 +++--- recipes/gsoap/all/test_package/conanfile.py | 44 ++++++++++++------- .../gsoap/all/test_v1_package/conanfile.py | 16 ++++--- 3 files changed, 46 insertions(+), 27 deletions(-) diff --git a/recipes/gsoap/all/conanfile.py b/recipes/gsoap/all/conanfile.py index 49ca4cbe85bbd..38b4629ae4211 100644 --- a/recipes/gsoap/all/conanfile.py +++ b/recipes/gsoap/all/conanfile.py @@ -3,7 +3,6 @@ from conan.tools.cmake import CMakeToolchain, CMakeDeps, CMake, cmake_layout from conan.tools.env import VirtualBuildEnv from conan.tools.files import copy, get -from conan.tools.microsoft import is_msvc import os required_conan_version = ">=1.52.0" @@ -16,7 +15,8 @@ class GsoapConan(ConanFile): license = ("gSOAP-1.3b", "GPL-2.0-or-later") url = "https://github.com/conan-io/conan-center-index" homepage = "https://sourceforge.net/projects/gsoap2" - topics = ("gsoap", "logging") + topics = ("logging",) + package_type = "static-library" settings = "os", "arch", "compiler", "build_type" options = { "fPIC": [True, False], @@ -49,22 +49,21 @@ def layout(self): def requirements(self): if self.options.with_openssl: - self.requires("openssl/1.1.1s") + self.requires("openssl/[>=1.1 <4]", transitive_headers=True) self.requires("zlib/1.2.13") def build_requirements(self): if cross_building(self, skip_x64_x86=True) and hasattr(self, "settings_build"): self.tool_requires(f"gsoap/{self.version}") - if is_msvc(self, build_context=True): + if self._settings_build.os == "Windows": self.tool_requires("winflexbison/2.5.24") else: - self.tool_requires("bison/3.7.6") + self.tool_requires("bison/3.8.2") self.tool_requires("flex/2.6.4") def source(self): - get(self, **self.conan_data["sources"][self.version], - destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): toolchain = CMakeToolchain(self) diff --git a/recipes/gsoap/all/test_package/conanfile.py b/recipes/gsoap/all/test_package/conanfile.py index b6f1a8aefca6f..1ea623e022729 100644 --- a/recipes/gsoap/all/test_package/conanfile.py +++ b/recipes/gsoap/all/test_package/conanfile.py @@ -1,33 +1,47 @@ -from conan import ConanFile -from conan.tools.build import can_run, cross_building +from conan import ConanFile, conan_version +from conan.tools.build import can_run from conan.tools.cmake import CMake, cmake_layout +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv +from conan.tools.scm import Version import os -class TestGsoapConan(ConanFile): +class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + generators = "CMakeDeps", "CMakeToolchain" test_type = "explicit" def layout(self): cmake_layout(self) def requirements(self): - self.requires(self.tested_reference_str) + self.requires(self.tested_reference_str, run=can_run(self)) - def build(self): - # TODO: Add some test for the cross-building scenario + def build_requirements(self): + if not can_run(self): + self.tool_requires(self.tested_reference_str) + + def generate(self): + VirtualRunEnv(self).generate() + if can_run(self): + VirtualRunEnv(self).generate(scope="build") + else: + VirtualBuildEnv(self).generate() - if not cross_building(self): - calc_wsdl = os.path.join(self.source_folder, "calc.wsdl") - self.output.info(f"Generating code from WSDL '{calc_wsdl}'") - self.run(f"wsdl2h -o calc.h {calc_wsdl}", env="conanrun") + def build(self): + calc_wsdl = os.path.join(self.source_folder, "calc.wsdl") + self.output.info(f"Generating code from WSDL '{calc_wsdl}'") + self.run(f"wsdl2h -o calc.h {calc_wsdl}") + if Version(conan_version).major < "2": + # conan v1 limitation: self.dependencies is not defined in build() method of test package import_dir = os.path.join(self.deps_cpp_info["gsoap"].rootpath, "bin", "import") - self.run(f"soapcpp2 -j -CL -I{import_dir} calc.h", env="conanrun") + else: + import_dir = os.path.join(self.dependencies["gsoap"].package_folder, "bin", "import") + self.run(f"soapcpp2 -j -CL -I{import_dir} calc.h") - cmake = CMake(self) - cmake.configure() - cmake.build() + cmake = CMake(self) + cmake.configure() + cmake.build() def test(self): if can_run(self): diff --git a/recipes/gsoap/all/test_v1_package/conanfile.py b/recipes/gsoap/all/test_v1_package/conanfile.py index efaa7d687c237..27d9e27609d72 100644 --- a/recipes/gsoap/all/test_v1_package/conanfile.py +++ b/recipes/gsoap/all/test_v1_package/conanfile.py @@ -5,16 +5,22 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = "cmake", "cmake_find_package_multi" + test_type = "explicit" - def build(self): - # TODO: Add some test for the cross-building scenario + def requirements(self): + self.requires(self.tested_reference_str) - if not tools.cross_building(self): + def build_requirements(self): + if hasattr(self, "settings_build"): + self.build_requires(self.tested_reference_str) + + def build(self): + with tools.no_op() if hasattr(self, "settings_build") else tools.run_environment(self): calc_wsdl = os.path.join(self.source_folder, os.pardir, "test_package", "calc.wsdl") self.output.info(f"Generating code from WSDL '{calc_wsdl}'") - self.run(f"wsdl2h -o calc.h {calc_wsdl}", run_environment=True) + self.run(f"wsdl2h -o calc.h {calc_wsdl}") import_dir = os.path.join(self.deps_cpp_info["gsoap"].rootpath, "bin", "import") - self.run(f"soapcpp2 -j -CL -I{import_dir} calc.h", run_environment=True) + self.run(f"soapcpp2 -j -CL -I{import_dir} calc.h") cmake = CMake(self) cmake.configure() From 470686fda1856e859305876811998d8077036e7a Mon Sep 17 00:00:00 2001 From: Conan Center Index Bot <54393557+conan-center-bot@users.noreply.github.com> Date: Fri, 28 Apr 2023 18:01:51 +0200 Subject: [PATCH 07/34] (#17278) [bot] Update authorized users list (2023-04-27) --- .c3i/authorized_users.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.c3i/authorized_users.yml b/.c3i/authorized_users.yml index 38d2519d6078c..1ecee66230033 100644 --- a/.c3i/authorized_users.yml +++ b/.c3i/authorized_users.yml @@ -1128,3 +1128,4 @@ authorized_users: - silvergasp - doocman - gouarin +- gegles From 98d3128500cdf3cd0c204804af1d4b2b5af6f1c7 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Fri, 28 Apr 2023 18:24:08 +0200 Subject: [PATCH 08/34] (#17087) qpdf: bump openssl * bump openssl * use version range for openssl * use version range for cmake * more elegant version range for cmake * remove _cmake_new_enough * upper bound --- recipes/qpdf/all/conanfile.py | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/recipes/qpdf/all/conanfile.py b/recipes/qpdf/all/conanfile.py index b3981f4ed09dc..d5b0654a5d179 100644 --- a/recipes/qpdf/all/conanfile.py +++ b/recipes/qpdf/all/conanfile.py @@ -64,9 +64,7 @@ def requirements(self): # https://qpdf.readthedocs.io/en/stable/installation.html#basic-dependencies self.requires("zlib/1.2.13") if self.options.with_ssl == "openssl": - self.requires("openssl/1.1.1t") - elif self.options.with_ssl == "gnutls": - raise ConanInvalidConfiguration("GnuTLS is not available in Conan Center yet.") + self.requires("openssl/[>=1.1 <4]") if self.options.with_jpeg == "libjpeg": self.requires("libjpeg/9e") elif self.options.with_jpeg == "libjpeg-turbo": @@ -84,20 +82,11 @@ def validate(self): f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." ) - def _cmake_new_enough(self, required_version): - try: - import re - from io import StringIO - output = StringIO() - self.run("cmake --version", output) - m = re.search(r"cmake version (\d+\.\d+\.\d+)", output.getvalue()) - return Version(m.group(1)) >= required_version - except: - return False + if self.options.with_ssl == "gnutls": + raise ConanInvalidConfiguration("GnuTLS is not available in Conan Center yet.") def build_requirements(self): - if not self._cmake_new_enough("3.16"): - self.tool_requires("cmake/3.25.3") + self.tool_requires("cmake/[>=3.16 <4]") if not self.conf.get("tools.gnu:pkg_config", check_type=str): self.tool_requires("pkgconf/1.9.3") From 359a0ae2439e27aa1d5aac1155fda776fc47f534 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Fri, 28 Apr 2023 19:02:26 +0200 Subject: [PATCH 09/34] (#17287) duckdb: use version range for openssl --- recipes/duckdb/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/duckdb/all/conanfile.py b/recipes/duckdb/all/conanfile.py index e4e20e16d2314..34aad40c19a16 100644 --- a/recipes/duckdb/all/conanfile.py +++ b/recipes/duckdb/all/conanfile.py @@ -81,7 +81,7 @@ def requirements(self): if self.options.with_odbc: self.requires("odbc/2.3.11") if self.options.with_httpfs: - self.requires("openssl/3.0.7") + self.requires("openssl/[>=1.1 <4]") def validate(self): if self.settings.compiler.cppstd: From 9d6eafdcf67ebc22c9886372aa2db4937b66878e Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Fri, 28 Apr 2023 19:43:37 +0200 Subject: [PATCH 10/34] (#17080) opusfile: add package_type + bump openssl * bump openssl * add package_type * add transitive headers * opus also public * use version range for openssl --- recipes/opusfile/all/conanfile.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/recipes/opusfile/all/conanfile.py b/recipes/opusfile/all/conanfile.py index c7c9a6ee8b4e2..ec4750c742092 100644 --- a/recipes/opusfile/all/conanfile.py +++ b/recipes/opusfile/all/conanfile.py @@ -18,6 +18,7 @@ class OpusFileConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/xiph/opusfile" license = "BSD-3-Clause" + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -55,10 +56,10 @@ def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("ogg/1.3.5") - self.requires("opus/1.3.1") + self.requires("ogg/1.3.5", transitive_headers=True) + self.requires("opus/1.3.1", transitive_headers=True) if self.options.http: - self.requires("openssl/1.1.1s") + self.requires("openssl/[>=1.1 <4]") def validate(self): if is_msvc(self) and self.options.shared: From da463ec9dddc3bc4d3482c718f0f58532f3d355c Mon Sep 17 00:00:00 2001 From: Gregory Popovitch Date: Fri, 28 Apr 2023 14:02:10 -0400 Subject: [PATCH 11/34] (#17291) [parallel-hashmap] Update version to 1.3.11 * [parallel-hashmap] Update version to 1.3.11 and conan v2 support * Add GTL Package * Revert "Add GTL Package" This reverts commit 6dd5d607c15c9ccd9ad11d07f941490a9224dd19. * Update recipes/parallel-hashmap/all/conanfile.py Co-authored-by: SpaceIm <30052553+SpaceIm@users.noreply.github.com> --------- Co-authored-by: SpaceIm <30052553+SpaceIm@users.noreply.github.com> --- recipes/parallel-hashmap/all/conandata.yml | 3 +++ recipes/parallel-hashmap/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/parallel-hashmap/all/conandata.yml b/recipes/parallel-hashmap/all/conandata.yml index 41fe3e31571e0..e810473c6e2e7 100644 --- a/recipes/parallel-hashmap/all/conandata.yml +++ b/recipes/parallel-hashmap/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.3.11": + url: "https://github.com/greg7mdp/parallel-hashmap/archive/refs/tags/v1.3.11.tar.gz" + sha256: "0515a681bfb24207013786a7737e9d8561302e656689d8a65ea480bbabab460f" "1.3.8": url: "https://github.com/greg7mdp/parallel-hashmap/archive/v1.3.8.tar.gz" sha256: "c4562ea360dc1dcaddd96a0494c753400364a52c7aa9750de49d8e6a222d28d3" diff --git a/recipes/parallel-hashmap/config.yml b/recipes/parallel-hashmap/config.yml index 2115f091019fe..a8a50d11cadad 100644 --- a/recipes/parallel-hashmap/config.yml +++ b/recipes/parallel-hashmap/config.yml @@ -1,4 +1,6 @@ versions: + "1.3.11": + folder: all "1.3.8": folder: all "1.37": From f3d9a7f9c8218ce614e2e57a3b4b7e1f9360c14e Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Fri, 28 Apr 2023 20:24:19 +0200 Subject: [PATCH 12/34] (#17259) cpp-httplib: use version range for openssl --- recipes/cpp-httplib/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/cpp-httplib/all/conanfile.py b/recipes/cpp-httplib/all/conanfile.py index 218cdbba77338..fafe791af7015 100644 --- a/recipes/cpp-httplib/all/conanfile.py +++ b/recipes/cpp-httplib/all/conanfile.py @@ -35,7 +35,7 @@ def config_options(self): def requirements(self): if self.options.with_openssl: - self.requires("openssl/1.1.1t") + self.requires("openssl/[>=1.1 <4]") if self.options.with_zlib: self.requires("zlib/1.2.13") if self.options.get_safe("with_brotli"): From 5fba21b506a69bbb9a932b057674b175a64e60f8 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Fri, 28 Apr 2023 21:03:05 +0200 Subject: [PATCH 13/34] (#17290) libtiff: bump dependencies --- recipes/libtiff/all/conanfile.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/recipes/libtiff/all/conanfile.py b/recipes/libtiff/all/conanfile.py index ed90e33f1af31..9d78f893c2d31 100644 --- a/recipes/libtiff/all/conanfile.py +++ b/recipes/libtiff/all/conanfile.py @@ -83,9 +83,9 @@ def requirements(self): if self.options.zlib: self.requires("zlib/1.2.13") if self.options.get_safe("libdeflate"): - self.requires("libdeflate/1.17") + self.requires("libdeflate/1.18") if self.options.lzma: - self.requires("xz_utils/5.4.0") + self.requires("xz_utils/5.4.2") if self.options.jpeg == "libjpeg": self.requires("libjpeg/9e") elif self.options.jpeg == "libjpeg-turbo": @@ -95,7 +95,7 @@ def requirements(self): if self.options.jbig: self.requires("jbig/20160605") if self.options.get_safe("zstd"): - self.requires("zstd/1.5.4") + self.requires("zstd/1.5.5") if self.options.get_safe("webp"): self.requires("libwebp/1.3.0") From d04defadff2c3618ce4946cb9cf3546dbb8ac2bb Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Fri, 28 Apr 2023 12:43:10 -0700 Subject: [PATCH 14/34] (#17266) restinio: bump dependencies * restinio: bump dependencies * fixup: typo for boot version --- recipes/restinio/all/conanfile.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/recipes/restinio/all/conanfile.py b/recipes/restinio/all/conanfile.py index f8da952c6fcac..16542fcac1126 100644 --- a/recipes/restinio/all/conanfile.py +++ b/recipes/restinio/all/conanfile.py @@ -46,7 +46,7 @@ def requirements(self): else: self.requires("fmt/8.1.1") - self.requires("expected-lite/0.5.0") + self.requires("expected-lite/0.6.2") self.requires("optional-lite/3.5.0") self.requires("string-view-lite/1.6.0") self.requires("variant-lite/2.0.0") @@ -58,15 +58,15 @@ def requirements(self): self.requires("asio/1.16.1") else: if Version(self.version) >= "0.6.9": - self.requires("boost/1.78.0") + self.requires("boost/1.81.0") else: self.requires("boost/1.73.0") if self.options.with_openssl: - self.requires("openssl/1.1.1n") + self.requires("openssl/1.1.1t") if self.options.with_zlib: - self.requires("zlib/1.2.12") + self.requires("zlib/1.2.13") if self.options.with_pcre == 1: self.requires("pcre/8.45") From 2dc2a4fa215e47d613a38b911cd781cde16e404f Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Fri, 28 Apr 2023 13:03:11 -0700 Subject: [PATCH 15/34] (#17265) expected-lite: add version 0.6.3 Generated and committed by [Conan Center Bot](https://github.com/qchateau/conan-center-bot) Find more updatable recipes in the [GitHub Pages](https://qchateau.github.io/conan-center-bot/) Co-authored-by: Quentin Chateau via Conan Center Bot --- recipes/expected-lite/all/conandata.yml | 3 +++ recipes/expected-lite/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/expected-lite/all/conandata.yml b/recipes/expected-lite/all/conandata.yml index 164f98f702d8b..d3a6677071af2 100644 --- a/recipes/expected-lite/all/conandata.yml +++ b/recipes/expected-lite/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.6.3": + url: "https://github.com/martinmoene/expected-lite/archive/v0.6.3.tar.gz" + sha256: "b2f90d5f03f6423ec67cc3c06fd0c4e813ec10c4313062b875b37d17593b57b4" "0.6.2": url: "https://github.com/martinmoene/expected-lite/archive/v0.6.2.tar.gz" sha256: "8e3c58fddb32abc22a429543440554f1ae50d1de3fb9a0abf699bc3f247dc1da" diff --git a/recipes/expected-lite/config.yml b/recipes/expected-lite/config.yml index ad5f08f24e4fd..9fcad808e37e7 100644 --- a/recipes/expected-lite/config.yml +++ b/recipes/expected-lite/config.yml @@ -1,4 +1,6 @@ versions: + "0.6.3": + folder: all "0.6.2": folder: all "0.6.1": From 23ae3c36e23d703a16dccb8e6de4c7cdd9fce569 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Fri, 28 Apr 2023 22:25:53 +0200 Subject: [PATCH 16/34] (#17233) qarchive: fix recipe for conan v2 + use version range for cmake - use conan.tools.files.copy instead of self.copy - add package_type - protect double deletion of fPIC - bump dependencies - use version range for cmake - fix import of cmake_layout in test package --- recipes/qarchive/all/conanfile.py | 25 +++++++++---------- .../qarchive/all/test_package/conanfile.py | 4 +-- .../all/test_v1_package/CMakeLists.txt | 11 +++----- 3 files changed, 17 insertions(+), 23 deletions(-) diff --git a/recipes/qarchive/all/conanfile.py b/recipes/qarchive/all/conanfile.py index 5cf8969c4ade0..b299a0c2ae050 100644 --- a/recipes/qarchive/all/conanfile.py +++ b/recipes/qarchive/all/conanfile.py @@ -1,11 +1,11 @@ from conan import ConanFile -from conan.tools.files import get, apply_conandata_patches, rmdir, save, export_conandata_patches from conan.tools.cmake import CMakeToolchain, CMake, cmake_layout, CMakeDeps +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir, save from conan.tools.scm import Version import os import textwrap -required_conan_version = ">=1.52.0" +required_conan_version = ">=1.53.0" class QarchiveConan(ConanFile): @@ -18,7 +18,7 @@ class QarchiveConan(ConanFile): "This library helps you to extract and compress archives supported by libarchive" ) topics = ("qt", "compress", "libarchive") - + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -42,21 +42,20 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): - self.requires("libarchive/3.6.1") - self.requires("qt/5.15.7") + self.requires("libarchive/3.6.2") + self.requires("qt/5.15.9") def build_requirements(self): - self.tool_requires("cmake/3.24.2") - - def layout(self): - cmake_layout(self, src_folder="src") + self.tool_requires("cmake/[>=3.17 <4]") def source(self): - get(self, **self.conan_data["sources"][self.version], - destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): tc = CMakeToolchain(self) @@ -73,7 +72,7 @@ def build(self): cmake.build() def package(self): - self.copy("LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) cmake = CMake(self) cmake.install() rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) diff --git a/recipes/qarchive/all/test_package/conanfile.py b/recipes/qarchive/all/test_package/conanfile.py index 0a318ba85a952..8e6ae76816f4e 100644 --- a/recipes/qarchive/all/test_package/conanfile.py +++ b/recipes/qarchive/all/test_package/conanfile.py @@ -1,8 +1,8 @@ import os from conan import ConanFile from conan.tools.build import can_run -from conan.tools.cmake import CMake -from conan.tools.layout import cmake_layout +from conan.tools.cmake import CMake, cmake_layout + class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" diff --git a/recipes/qarchive/all/test_v1_package/CMakeLists.txt b/recipes/qarchive/all/test_v1_package/CMakeLists.txt index cf1b8efc8c833..0d20897301b68 100644 --- a/recipes/qarchive/all/test_v1_package/CMakeLists.txt +++ b/recipes/qarchive/all/test_v1_package/CMakeLists.txt @@ -1,13 +1,8 @@ cmake_minimum_required(VERSION 3.1) -project(test_package CXX) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(QArchive REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} QArchive) -# Must compile with "-fPIC" since Qt was built with -reduce-relocations. -target_compile_options(${PROJECT_NAME} PRIVATE -fPIC) -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) From 98150fd03a7148a01eb8a5a57ee0f85aa136e812 Mon Sep 17 00:00:00 2001 From: Jordan Williams Date: Fri, 28 Apr 2023 16:12:18 -0500 Subject: [PATCH 17/34] (#17197) libffi/3.4.3: Add patch to allow building with the C2x standard This patch allows building with newer versions of Clang out-of-the-box. Clang 15.0.0 removed support for implicit function declarations. This is mentioned here: https://releases.llvm.org/15.0.0/tools/clang/docs/ReleaseNotes.html#c2x-feature-support. This removal breaks builds using the default C standard in Clang. This is because the function open_temp_exec_file is not properly declared. This patch is from the upstream project and declares the function. --- recipes/libffi/all/conandata.yml | 4 +++ ...-forward-declare-open_temp_exec_file.patch | 30 +++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 recipes/libffi/all/patches/0007-3.4.3-forward-declare-open_temp_exec_file.patch diff --git a/recipes/libffi/all/conandata.yml b/recipes/libffi/all/conandata.yml index f5c063ead8052..3333c954f7024 100644 --- a/recipes/libffi/all/conandata.yml +++ b/recipes/libffi/all/conandata.yml @@ -22,6 +22,10 @@ patches: - patch_file: "patches/0004-3.3-fix-complex-type-msvc.patch" - patch_file: "patches/0005-3.4.3-do-not-install-libraries-to-arch-dependent-directories.patch" - patch_file: "patches/0006-3.4.3-library-no-version-suffix.patch" + - patch_file: "patches/0007-3.4.3-forward-declare-open_temp_exec_file.patch" + patch_type: "portability" + patch_source: "https://github.com/libffi/libffi/pull/764" + patch_description: "Forward declare the open_temp_exec_file function which is required by the C99 standard" "3.4.2": - patch_file: "patches/0002-3.4.2-fix-libtool-path.patch" - patch_file: "patches/0004-3.3-fix-complex-type-msvc.patch" diff --git a/recipes/libffi/all/patches/0007-3.4.3-forward-declare-open_temp_exec_file.patch b/recipes/libffi/all/patches/0007-3.4.3-forward-declare-open_temp_exec_file.patch new file mode 100644 index 0000000000000..a2e9d8e2661aa --- /dev/null +++ b/recipes/libffi/all/patches/0007-3.4.3-forward-declare-open_temp_exec_file.patch @@ -0,0 +1,30 @@ +diff --git a/include/ffi_common.h b/include/ffi_common.h +index 2bd31b0..c53a794 100644 +--- a/include/ffi_common.h ++++ b/include/ffi_common.h +@@ -128,6 +128,10 @@ void *ffi_data_to_code_pointer (void *data) FFI_HIDDEN; + static trampoline. */ + int ffi_tramp_is_present (void *closure) FFI_HIDDEN; + ++/* Return a file descriptor of a temporary zero-sized file in a ++ writable and executable filesystem. */ ++int open_temp_exec_file(void) FFI_HIDDEN; ++ + /* Extended cif, used in callback from assembly routine */ + typedef struct + { +diff --git a/src/tramp.c b/src/tramp.c +index b9d273a..c3f4c99 100644 +--- a/src/tramp.c ++++ b/src/tramp.c +@@ -39,6 +39,10 @@ + #ifdef __linux__ + #define _GNU_SOURCE 1 + #endif ++ ++#include ++#include ++ + #include + #include + #include From 949183818530df94c5cc14289aa6ffdf48abe502 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Sat, 29 Apr 2023 00:14:57 +0200 Subject: [PATCH 18/34] (#17119) aws-checksums: add missing interface definition if shared + modernize more for conan v2 * add AWS_CHECKSUMS_USE_IMPORT_EXPORT interface definition if shared * modernize more * more elegant way to define target for legacy generators --- recipes/aws-checksums/all/conanfile.py | 63 +++++++++++-------- .../all/test_v1_package/CMakeLists.txt | 8 +-- 2 files changed, 39 insertions(+), 32 deletions(-) diff --git a/recipes/aws-checksums/all/conanfile.py b/recipes/aws-checksums/all/conanfile.py index d3412c3a07b16..80a0c88a8c55b 100644 --- a/recipes/aws-checksums/all/conanfile.py +++ b/recipes/aws-checksums/all/conanfile.py @@ -1,9 +1,11 @@ from conan import ConanFile from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout -from conan.tools.files import apply_conandata_patches, export_conandata_patches, copy, get, rmdir +from conan.tools.files import apply_conandata_patches, export_conandata_patches, copy, get, rmdir, save import os +import textwrap + +required_conan_version = ">=1.53.0" -required_conan_version = ">=1.52.0" class AwsChecksums(ConanFile): name = "aws-checksums" @@ -11,10 +13,11 @@ class AwsChecksums(ConanFile): "Cross-Platform HW accelerated CRC32c and CRC32 with fallback to efficient " "SW implementations. C interface with language bindings for each of our SDKs." ) - license = "Apache-2.0", + license = "Apache-2.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/awslabs/aws-checksums" topics = ("aws", "checksum", ) + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -34,18 +37,9 @@ def config_options(self): def configure(self): if self.options.shared: - try: - del self.options.fPIC - except Exception: - pass - try: - del self.settings.compiler.libcxx - except Exception: - pass - try: - del self.settings.compiler.cppstd - except Exception: - pass + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") def layout(self): cmake_layout(self, src_folder="src") @@ -54,8 +48,7 @@ def requirements(self): self.requires("aws-c-common/0.8.2") def source(self): - get(self, **self.conan_data["sources"][self.version], - destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): tc = CMakeToolchain(self) @@ -76,18 +69,34 @@ def package(self): cmake.install() rmdir(self, os.path.join(self.package_folder, "lib", "aws-checksums")) + # TODO: to remove in conan v2 once legacy generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {"AWS::aws-checksums": "aws-checksums::aws-checksums"} + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + def package_info(self): self.cpp_info.set_property("cmake_file_name", "aws-checksums") self.cpp_info.set_property("cmake_target_name", "AWS::aws-checksums") - # TODO: back to global scope in conan v2 once cmake_find_package* generators removed - self.cpp_info.components["aws-checksums-lib"].libs = ["aws-checksums"] + self.cpp_info.libs = ["aws-checksums"] + if self.options.shared: + self.cpp_info.defines.append("AWS_CHECKSUMS_USE_IMPORT_EXPORT") # TODO: to remove in conan v2 once cmake_find_package* generators removed - self.cpp_info.filenames["cmake_find_package"] = "aws-checksums" - self.cpp_info.filenames["cmake_find_package_multi"] = "aws-checksums" - self.cpp_info.names["cmake_find_package"] = "AWS" - self.cpp_info.names["cmake_find_package_multi"] = "AWS" - self.cpp_info.components["aws-checksums-lib"].names["cmake_find_package"] = "aws-checksums" - self.cpp_info.components["aws-checksums-lib"].names["cmake_find_package_multi"] = "aws-checksums" - self.cpp_info.components["aws-checksums-lib"].set_property("cmake_target_name", "AWS::aws-checksums") - self.cpp_info.components["aws-checksums-lib"].requires = ["aws-c-common::aws-c-common-lib"] + self.cpp_info.build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] diff --git a/recipes/aws-checksums/all/test_v1_package/CMakeLists.txt b/recipes/aws-checksums/all/test_v1_package/CMakeLists.txt index 915af9f83a60f..0d20897301b68 100644 --- a/recipes/aws-checksums/all/test_v1_package/CMakeLists.txt +++ b/recipes/aws-checksums/all/test_v1_package/CMakeLists.txt @@ -1,10 +1,8 @@ cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES C) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(aws-checksums REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE AWS::aws-checksums) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) From ede71611639dfdc93aa1557164eb2971e2ebc945 Mon Sep 17 00:00:00 2001 From: Ivo Hedtke Date: Sat, 29 Apr 2023 01:03:43 +0200 Subject: [PATCH 19/34] (#17115) coin-clp: make dependency on coin-utils libs transitive * coin-clp: make dependency on coin-utils libs transitive This fixed linking problems with coin-clp: https://github.com/conan-io/conan-center-index/pull/16053#issuecomment-1512637106 * Update recipes/coin-clp/all/conanfile.py Co-authored-by: Chris Mc --------- Co-authored-by: Chris Mc --- recipes/coin-clp/all/conanfile.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/recipes/coin-clp/all/conanfile.py b/recipes/coin-clp/all/conanfile.py index d9945fab24333..94e548dfba655 100644 --- a/recipes/coin-clp/all/conanfile.py +++ b/recipes/coin-clp/all/conanfile.py @@ -49,7 +49,8 @@ def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("coin-utils/2.11.6", transitive_headers=True) + # Symbols are exposed https://github.com/conan-io/conan-center-index/pull/16053#issuecomment-1512637106 + self.requires("coin-utils/2.11.6", transitive_headers=True, transitive_libs=True) self.requires("coin-osi/0.108.7", transitive_headers=True) def validate(self): From b7896c3fe6c25584afbe6c91e4e36f9db61b90e6 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Sat, 29 Apr 2023 01:24:39 +0200 Subject: [PATCH 20/34] (#17062) xmlsec: fix url of tarballs + bump dependencies * fix url of tarballs * bump dependencies * libxml2 public headers are exposed in xmlsec public headers * add libxml2 to requires of test package for conan v2 since it's directly used in test source code * link to libxml2 and eventually libxslt in test package * openssl headers are also public * typo * add libxml2 to requires of test package since CMakeDeps seems to be affected by traits * use https * use version range for openssl --- recipes/xmlsec/all/conandata.yml | 6 +++--- recipes/xmlsec/all/conanfile.py | 14 +++++++++++--- recipes/xmlsec/all/test_package/CMakeLists.txt | 9 ++++++++- recipes/xmlsec/all/test_package/conanfile.py | 10 ++++++++-- recipes/xmlsec/all/test_v1_package/conanfile.py | 3 ++- 5 files changed, 32 insertions(+), 10 deletions(-) diff --git a/recipes/xmlsec/all/conandata.yml b/recipes/xmlsec/all/conandata.yml index 0f782600a7b31..46664dc0decc9 100644 --- a/recipes/xmlsec/all/conandata.yml +++ b/recipes/xmlsec/all/conandata.yml @@ -1,10 +1,10 @@ sources: "1.2.32": - url: "http://www.aleksey.com/xmlsec/download/xmlsec1-1.2.32.tar.gz" + url: "https://www.aleksey.com/xmlsec/download/older-releases/xmlsec1-1.2.32.tar.gz" sha256: "e383702853236004e5b08e424b8afe9b53fe9f31aaa7a5382f39d9533eb7c043" "1.2.31": - url: "http://www.aleksey.com/xmlsec/download/xmlsec1-1.2.31.tar.gz" + url: "https://www.aleksey.com/xmlsec/download/older-releases/xmlsec1-1.2.31.tar.gz" sha256: "9b10bc52cc31e4f76162e3975e50db26b71ab49c571d810b311ca626be5a0b26" "1.2.30": - url: "http://www.aleksey.com/xmlsec/download/xmlsec1-1.2.30.tar.gz" + url: "https://www.aleksey.com/xmlsec/download/older-releases/xmlsec1-1.2.30.tar.gz" sha256: "2d84360b03042178def1d9ff538acacaed2b3a27411db7b2874f1612ed71abc8" diff --git a/recipes/xmlsec/all/conanfile.py b/recipes/xmlsec/all/conanfile.py index 507ae2456e030..6cbfca0ca36ca 100644 --- a/recipes/xmlsec/all/conanfile.py +++ b/recipes/xmlsec/all/conanfile.py @@ -60,9 +60,9 @@ def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("libxml2/2.10.3") + self.requires("libxml2/2.10.4", transitive_headers=True) if self.options.with_openssl: - self.requires("openssl/1.1.1s") + self.requires("openssl/[>=1.1 <4]", transitive_headers=True) if self.options.with_xslt: self.requires("libxslt/1.1.34") @@ -140,7 +140,15 @@ def build(self): crypto_engines = [] if self.options.with_openssl: ov = Version(self.dependencies["openssl"].ref.version) - crypto_engines.append(f"openssl={ov.major}{ov.minor}0") + if ov.major >= "3": + if Version(self.version) < "1.2.35": + # configure.js doesn't understand openssl=300 before xmlsec 1.2.35, + # For these xmlsec versions, setting 110 even for OpenSSL 3.x should be compatible + crypto_engines.append("openssl=110") + else: + crypto_engines.append("openssl=300") + else: + crypto_engines.append(f"openssl={ov.major}{ov.minor}0") yes_no = lambda v: "yes" if v else "no" args = [ diff --git a/recipes/xmlsec/all/test_package/CMakeLists.txt b/recipes/xmlsec/all/test_package/CMakeLists.txt index b99fa5a5fed63..926e0b1fdcb15 100644 --- a/recipes/xmlsec/all/test_package/CMakeLists.txt +++ b/recipes/xmlsec/all/test_package/CMakeLists.txt @@ -2,6 +2,13 @@ cmake_minimum_required(VERSION 3.1) project(test_package LANGUAGES C) find_package(xmlsec REQUIRED CONFIG) +find_package(LibXml2 REQUIRED MODULE) +if(XMLSEC_WITH_XSLT) + find_package(LibXslt REQUIRED MODULE) +endif() add_executable(${PROJECT_NAME} sign1.c) -target_link_libraries(${PROJECT_NAME} PRIVATE xmlsec::xmlsec) +target_link_libraries(${PROJECT_NAME} PRIVATE LibXml2::LibXml2 xmlsec::xmlsec) +if(XMLSEC_WITH_XSLT) + target_link_libraries(${PROJECT_NAME} PRIVATE LibXslt::LibXslt) +endif() diff --git a/recipes/xmlsec/all/test_package/conanfile.py b/recipes/xmlsec/all/test_package/conanfile.py index 80f642849361b..e977f9247d9e3 100644 --- a/recipes/xmlsec/all/test_package/conanfile.py +++ b/recipes/xmlsec/all/test_package/conanfile.py @@ -1,12 +1,12 @@ from conan import ConanFile from conan.tools.build import can_run -from conan.tools.cmake import CMake, cmake_layout +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + generators = "CMakeDeps", "VirtualRunEnv" test_type = "explicit" def layout(self): @@ -14,6 +14,12 @@ def layout(self): def requirements(self): self.requires(self.tested_reference_str) + self.requires("libxml2/2.10.4") + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["XMLSEC_WITH_XSLT"] = self.dependencies["xmlsec"].options.with_xslt + tc.generate() def build(self): cmake = CMake(self) diff --git a/recipes/xmlsec/all/test_v1_package/conanfile.py b/recipes/xmlsec/all/test_v1_package/conanfile.py index dd7e5cd83ea16..8a68c0f50f6f9 100644 --- a/recipes/xmlsec/all/test_v1_package/conanfile.py +++ b/recipes/xmlsec/all/test_v1_package/conanfile.py @@ -4,10 +4,11 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + generators = "cmake", "cmake_find_package", "cmake_find_package_multi" def build(self): cmake = CMake(self) + cmake.definitions["XMLSEC_WITH_XSLT"] = self.options["xmlsec"].with_xslt cmake.configure() cmake.build() From fc76e669dac1dc6f9e23d8da7a1e0dc24ddf258c Mon Sep 17 00:00:00 2001 From: Tobulus Date: Sat, 29 Apr 2023 02:04:53 +0200 Subject: [PATCH 21/34] (#16893) libbsd: support Conan v2 * libbsd: support Conan v2 * libbsd: fix linter messages * fix del libcxx, fix license * catch specific exception * fix licenses ... again * move to toolchain generator * fix: remove apple support https://gitlab.freedesktop.org/libbsd/libbsd/-/issues/1 * review comments * more cleanup * newline * linter messages * syntax * readd autoreconf * add patch source * more cleanup * more cleanup * is done by helper tools * more cleanup * fix test * duplicated delete, fix mac stuff * add package_type * fixup: prefer rm_safe --------- Co-authored-by: Chris Mc --- recipes/libbsd/all/conandata.yml | 4 +- recipes/libbsd/all/conanfile.py | 92 ++++++++++--------- .../libbsd/all/test_package/CMakeLists.txt | 5 +- recipes/libbsd/all/test_package/conanfile.py | 28 +++--- .../libbsd/all/test_v1_package/CMakeLists.txt | 8 ++ .../libbsd/all/test_v1_package/conanfile.py | 25 +++++ 6 files changed, 99 insertions(+), 63 deletions(-) create mode 100644 recipes/libbsd/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libbsd/all/test_v1_package/conanfile.py diff --git a/recipes/libbsd/all/conandata.yml b/recipes/libbsd/all/conandata.yml index 6ed28ef4d2392..5c7d8675d858e 100644 --- a/recipes/libbsd/all/conandata.yml +++ b/recipes/libbsd/all/conandata.yml @@ -5,4 +5,6 @@ sources: patches: "0.10.0": - patch_file: "patches/0001-support-macosx.patch" - base_path: "source_subfolder" + patch_description: "Enables building on MacOS" + patch_type: "portability" + patch_source: "https://github.com/NixOS/nixpkgs/blob/1016bfcff1df163aff75d908df1e00f897a29b9b/pkgs/development/libraries/libbsd/darwin.patch" diff --git a/recipes/libbsd/all/conanfile.py b/recipes/libbsd/all/conanfile.py index d921957f06961..468a858c4a3dc 100644 --- a/recipes/libbsd/all/conanfile.py +++ b/recipes/libbsd/all/conanfile.py @@ -1,8 +1,14 @@ -from conans import AutoToolsBuildEnvironment, ConanFile, tools -from conans.errors import ConanInvalidConfiguration -import glob import os +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.gnu import Autotools, AutotoolsToolchain, AutotoolsDeps +from conan.tools.apple import is_apple_os, fix_apple_shared_install_name +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, export_conandata_patches, copy, get, rmdir +from conan.tools.layout import basic_layout + +required_conan_version = ">=1.53.0" class LibBsdConan(ConanFile): name = "libbsd" @@ -12,6 +18,7 @@ class LibBsdConan(ConanFile): license = ("ISC", "MIT", "Beerware", "BSD-2-clause", "BSD-3-clause", "BSD-4-clause") homepage = "https://libbsd.freedesktop.org/wiki/" url = "https://github.com/conan-io/conan-center-index" + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -21,72 +28,66 @@ class LibBsdConan(ConanFile): "shared": False, "fPIC": True, } - exports_sources = "patches/**" - - _autotools = None def build_requirements(self): - self.build_requires("libtool/2.4.6") - - @property - def _source_subfolder(self): - return "source_subfolder" + self.tool_requires("libtool/2.4.7") + def export_sources(self): + export_conandata_patches(self) + def configure(self): if self.options.shared: - del self.options.fPIC - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + tc = AutotoolsToolchain(self) + if is_apple_os(self): + tc.extra_cflags.append("-Wno-error=implicit-function-declaration") + tc.generate() + deps = AutotoolsDeps(self) + deps.generate() + + def layout(self): + basic_layout(self, src_folder="src") def validate(self): - if not tools.is_apple_os(self.settings.os) and self.settings.os != "Linux": - raise ConanInvalidConfiguration("libbsd is only available for GNU-like operating systems (e.g. Linux)") + if not is_apple_os(self) and self.settings.os != "Linux": + raise ConanInvalidConfiguration(f"{self.ref} is only available for GNU-like operating systems (e.g. Linux)") def source(self): - tools.get(**self.conan_data["sources"][self.version], - strip_root=True, destination=self._source_subfolder) - - def _configure_autotools(self): - if self._autotools: - return self._autotools - self._autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) - if tools.is_apple_os(self.settings.os): - self._autotools.flags.append("-Wno-error=implicit-function-declaration") - conf_args = [ - ] - if self.options.shared: - conf_args.extend(["--enable-shared", "--disable-static"]) - else: - conf_args.extend(["--disable-shared", "--enable-static"]) - self._autotools.configure(args=conf_args, configure_dir=self._source_subfolder) - return self._autotools + get(self, **self.conan_data["sources"][self.version], strip_root=True) def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - with tools.chdir(self._source_subfolder): - self.run("autoreconf -fiv") - autotools = self._configure_autotools() + apply_conandata_patches(self) + autotools = Autotools(self) + autotools.autoreconf() + autotools.configure() autotools.make() def package(self): - self.copy("COPYING", src=self._source_subfolder, dst="licenses") - autotools = self._configure_autotools() + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + + autotools = Autotools(self) autotools.install() os.unlink(os.path.join(os.path.join(self.package_folder, "lib", "libbsd.la"))) - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) - tools.rmdir(os.path.join(self.package_folder, "share")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) + fix_apple_shared_install_name(self) def package_info(self): self.cpp_info.components["bsd"].libs = ["bsd"] - self.cpp_info.components["bsd"].names["pkg_config"] = "libbsd" + self.cpp_info.components["bsd"].set_property("pkg_config_name", "libbsd") self.cpp_info.components["libbsd-overlay"].libs = [] self.cpp_info.components["libbsd-overlay"].requires = ["bsd"] self.cpp_info.components["libbsd-overlay"].includedirs.append(os.path.join("include", "bsd")) self.cpp_info.components["libbsd-overlay"].defines = ["LIBBSD_OVERLAY"] - self.cpp_info.components["libbsd-overlay"].names["pkg_config"] = "libbsd-overlay" + self.cpp_info.components["libbsd-overlay"].set_property("pkg_config_name", "libbsd-overlay") # on apple-clang, GNU .init_array section is not supported if self.settings.compiler != "apple-clang": @@ -95,4 +96,5 @@ def package_info(self): if self.settings.os == "Linux": self.cpp_info.components["libbsd-ctor"].exelinkflags = ["-Wl,-z,nodlopen", "-Wl,-u,libbsd_init_func"] self.cpp_info.components["libbsd-ctor"].sharedlinkflags = ["-Wl,-z,nodlopen", "-Wl,-u,libbsd_init_func"] - self.cpp_info.components["libbsd-ctor"].names["pkg_config"] = "libbsd-ctor" + self.cpp_info.components["libbsd-ctor"].set_property("pkg_config_name", "libbsd-ctor") + diff --git a/recipes/libbsd/all/test_package/CMakeLists.txt b/recipes/libbsd/all/test_package/CMakeLists.txt index 532326ae9815e..d4aafe28c716a 100644 --- a/recipes/libbsd/all/test_package/CMakeLists.txt +++ b/recipes/libbsd/all/test_package/CMakeLists.txt @@ -1,10 +1,7 @@ cmake_minimum_required(VERSION 3.1) project(test_package C) -include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") -conan_basic_setup(TARGETS) - find_package(libbsd REQUIRED) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} libbsd::libbsd-overlay) +target_link_libraries(${PROJECT_NAME} PRIVATE libbsd::libbsd-overlay) diff --git a/recipes/libbsd/all/test_package/conanfile.py b/recipes/libbsd/all/test_package/conanfile.py index 6128ac2ebae8f..ec1844a785913 100644 --- a/recipes/libbsd/all/test_package/conanfile.py +++ b/recipes/libbsd/all/test_package/conanfile.py @@ -1,25 +1,27 @@ -from conans import ConanFile, CMake, tools -from conans.errors import ConanException import os +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake + class TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package", "pkg_config" + 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): - pcfiles = ["libbsd", "libbsd-overlay"] - if self.settings.compiler != "apple-clang": - pcfiles.append("libbsd-ctor") - for f in pcfiles: - pc = "{}.pc".format(f) - if not os.path.isfile(pc): - raise ConanException("{} not created by pkg_config generator".format(pc)) cmake = CMake(self) cmake.configure() cmake.build() def test(self): - if not tools.cross_building(self.settings): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + 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/libbsd/all/test_v1_package/CMakeLists.txt b/recipes/libbsd/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..cd6f4a15c06e7 --- /dev/null +++ b/recipes/libbsd/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/libbsd/all/test_v1_package/conanfile.py b/recipes/libbsd/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..6128ac2ebae8f --- /dev/null +++ b/recipes/libbsd/all/test_v1_package/conanfile.py @@ -0,0 +1,25 @@ +from conans import ConanFile, CMake, tools +from conans.errors import ConanException +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package", "pkg_config" + + def build(self): + pcfiles = ["libbsd", "libbsd-overlay"] + if self.settings.compiler != "apple-clang": + pcfiles.append("libbsd-ctor") + for f in pcfiles: + pc = "{}.pc".format(f) + if not os.path.isfile(pc): + raise ConanException("{} not created by pkg_config generator".format(pc)) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) From 472fb52dd0c1847f6c296faccca07665ec06ea9a Mon Sep 17 00:00:00 2001 From: Martin Wudenka Date: Sat, 29 Apr 2023 02:24:54 +0200 Subject: [PATCH 22/34] (#16847) implot: Adapt recipe to conan 2 * implot: Adapt recipe to conan 2 * implot: Change source subfolder to src May please v2 migration linter * implot: Add src_folder attr to cmake_layout May please conan v2 linter * implot: Add test_v1_package * implot: Use rm_safe to remove fPIC * implot: Add min CMake version to test_v1 CMakeLists * implot: Remove versions pre 0.13 Dependency imgui 1.86 is no longer in conan center * implot: Remove unused import * implot: Add IMGUI_DEFINE_MATH_OPERATORS compile definition imgui behavior changed with version 1.89.4 * implot: Remove versions pre 0.13 from conandata.yml * implot: Fiy layout src folder path * implot: Add CMake project specification to test_v1 * implot: Change handling of source folder * implot: Depend on imgui 1.88 for implot 0.13 * implot: Try run_environment=True in test_v1 * implot: Remove not needed rm_safe * implot: Remove file permission specification in CMake * implot: Define CMake generators by string Less verbose than in generate method * implot: Add VirtualRunEnv generator to test_package * implot: Add test_type to test package * implot: Lower required conan version to 1.54 * implot: tidy up conanfile * implot: Use bindirs[0] and not bindir in test_package * implot: use conan v1 generators in test_v1_package * implot: Readd versions 0.11 and 0.12 * implot Add missing new line to conandata.yml * implot Add missing new line to config.yml --- recipes/implot/all/CMakeLists.txt | 19 ++++--- recipes/implot/all/conanfile.py | 55 +++++++++++-------- .../implot/all/test_package/CMakeLists.txt | 3 - recipes/implot/all/test_package/conanfile.py | 22 ++++++-- .../implot/all/test_v1_package/CMakeLists.txt | 8 +++ .../implot/all/test_v1_package/conanfile.py | 23 ++++++++ 6 files changed, 89 insertions(+), 41 deletions(-) create mode 100644 recipes/implot/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/implot/all/test_v1_package/conanfile.py diff --git a/recipes/implot/all/CMakeLists.txt b/recipes/implot/all/CMakeLists.txt index 4a06ba1470e36..ec869caed9029 100644 --- a/recipes/implot/all/CMakeLists.txt +++ b/recipes/implot/all/CMakeLists.txt @@ -3,18 +3,19 @@ project(implot CXX) set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED ON) -include(conanbuildinfo.cmake) -conan_basic_setup() - set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) -set(SOURCE_DIR source_subfolder) -file(GLOB SOURCE_FILES ${SOURCE_DIR}/*.cpp) -file(GLOB HEADER_FILES ${SOURCE_DIR}/*.h) +file(GLOB SOURCE_FILES ${IMPLOT_SRC_DIR}/*.cpp) +file(GLOB HEADER_FILES ${IMPLOT_SRC_DIR}/*.h) add_library(${PROJECT_NAME} ${SOURCE_FILES}) -target_include_directories(${PROJECT_NAME} PRIVATE ${SOURCE_DIR}) -target_link_libraries(${PROJECT_NAME} PUBLIC ${CONAN_LIBS}) +target_include_directories(${PROJECT_NAME} PRIVATE ${IMPLOT_SRC_DIR}) + +find_package(imgui CONFIG REQUIRED) + +target_link_libraries(${PROJECT_NAME} PUBLIC imgui::imgui) + +target_compile_definitions(${PROJECT_NAME} PRIVATE IMGUI_DEFINE_MATH_OPERATORS) include(GNUInstallDirs) @@ -24,4 +25,4 @@ install(TARGETS ${PROJECT_NAME} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) install(FILES ${HEADER_FILES} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} - PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ) +) diff --git a/recipes/implot/all/conanfile.py b/recipes/implot/all/conanfile.py index c90ba7a4fb427..ce2e069d3196d 100644 --- a/recipes/implot/all/conanfile.py +++ b/recipes/implot/all/conanfile.py @@ -1,7 +1,10 @@ -from conans import ConanFile, CMake, tools -import functools +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import get, copy +from conan.tools.scm import Version +import os -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.54" class ImplotConan(ConanFile): name = "implot" @@ -11,9 +14,7 @@ class ImplotConan(ConanFile): topics = ("imgui", "plot", "graphics", ) license = "MIT" settings = "os", "arch", "compiler", "build_type" - - exports_sources = ["CMakeLists.txt"] - generators = "cmake" + package_type = "library" options = { "shared": [True, False], @@ -24,41 +25,47 @@ class ImplotConan(ConanFile): "fPIC": True } - @property - def _source_subfolder(self): - return "source_subfolder" + def export_sources(self): + copy(self, "CMakeLists.txt", self.recipe_folder, self.export_sources_folder) def config_options(self): if self.settings.os == "Windows": - del self.options.fPIC + del self.options.fPIC # rm_safe not needed def configure(self): if self.options.shared: - del self.options.fPIC + self.options.rm_safe("fPIC") def requirements(self): - if tools.Version(self.version) >= "0.13": - self.requires("imgui/1.87") + if Version(self.version) >= "0.14": + self.requires("imgui/1.89.4", transitive_headers=True) + elif Version(self.version) >= "0.13": + # imgui 1.89 renamed ImGuiKeyModFlags_* to ImGuiModFlags_* + self.requires("imgui/1.88", transitive_headers=True) else: - self.requires("imgui/1.86") + self.requires("imgui/1.86", transitive_headers=True) + + def layout(self): + cmake_layout(self, src_folder="src") def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) - functools.lru_cache(1) - def _configure_cmake(self): - cmake = CMake(self) - cmake.configure() - return cmake + def generate(self): + tc = CMakeToolchain(self) + tc.variables["IMPLOT_SRC_DIR"] = self.source_folder.replace("\\", "/") + tc.generate() + deps = CMakeDeps(self) + deps.generate() def build(self): - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) cmake.build() def package(self): - self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder) - cmake = self._configure_cmake() + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) cmake.install() def package_info(self): diff --git a/recipes/implot/all/test_package/CMakeLists.txt b/recipes/implot/all/test_package/CMakeLists.txt index 12c0824c90a91..945aea8b2724f 100644 --- a/recipes/implot/all/test_package/CMakeLists.txt +++ b/recipes/implot/all/test_package/CMakeLists.txt @@ -3,9 +3,6 @@ project(test_package) set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED ON) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - find_package(implot CONFIG REQUIRED) add_executable(${PROJECT_NAME} test_package.cpp) diff --git a/recipes/implot/all/test_package/conanfile.py b/recipes/implot/all/test_package/conanfile.py index 4576de7f46804..4b1e5bb19a0a2 100644 --- a/recipes/implot/all/test_package/conanfile.py +++ b/recipes/implot/all/test_package/conanfile.py @@ -1,15 +1,27 @@ -from conans import ConanFile, CMake, tools import os -class TestPackageConan(ConanFile): +from conan import ConanFile +from conan.tools.cmake import CMake, cmake_layout +from conan.tools.build import can_run + + +class ImplotTestConan(ConanFile): settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package_multi" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) cmake.configure() cmake.build() + def layout(self): + cmake_layout(self) + def test(self): - if not tools.cross_building(self): - self.run(os.path.join("bin", "test_package"), run_environment=True) + if can_run(self): + cmd = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(cmd, env="conanrun") diff --git a/recipes/implot/all/test_v1_package/CMakeLists.txt b/recipes/implot/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/implot/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/implot/all/test_v1_package/conanfile.py b/recipes/implot/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..4ef0320775f21 --- /dev/null +++ b/recipes/implot/all/test_v1_package/conanfile.py @@ -0,0 +1,23 @@ +import os + +from conans import ConanFile, CMake +from conans.tools import cross_building + + +class ImplotTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def 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 15fa7633c11b82ae1bdaf3440ab4855d5fd5c139 Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Sat, 29 Apr 2023 03:02:36 +0200 Subject: [PATCH 23/34] (#17301) glib: bump deps --- recipes/glib/all/conanfile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/glib/all/conanfile.py b/recipes/glib/all/conanfile.py index ed7433bf4dc2e..041447c27862e 100644 --- a/recipes/glib/all/conanfile.py +++ b/recipes/glib/all/conanfile.py @@ -66,7 +66,7 @@ def layout(self): def requirements(self): self.requires("zlib/1.2.13") - self.requires("libffi/3.4.3") + self.requires("libffi/3.4.4") if Version(self.version) >= "2.73.2": self.requires("pcre2/10.42") else: @@ -85,7 +85,7 @@ def requirements(self): self.requires("libiconv/1.17") def build_requirements(self): - self.tool_requires("meson/1.0.0") + self.tool_requires("meson/1.1.0") if not self.conf.get("tools.gnu:pkg_config", check_type=str): self.tool_requires("pkgconf/1.9.3") From 7a6655632ef95646b2ad4602c9382230df93f18d Mon Sep 17 00:00:00 2001 From: Andrew Kielbasinski Date: Fri, 28 Apr 2023 22:06:46 -0400 Subject: [PATCH 24/34] (#16375) wtl: port to v2 * wtl: port to v2 Added new source mirror (the other wasn't working) * Fix indentation * Remove extraneous character --- recipes/wtl/all/conandata.yml | 12 ++++-- recipes/wtl/all/conanfile.py | 39 ++++++++++++++----- recipes/wtl/all/test_package/CMakeLists.txt | 12 +++--- recipes/wtl/all/test_package/conanfile.py | 26 +++++++++---- .../wtl/all/test_v1_package/CMakeLists.txt | 8 ++++ recipes/wtl/all/test_v1_package/conanfile.py | 19 +++++++++ 6 files changed, 88 insertions(+), 28 deletions(-) create mode 100644 recipes/wtl/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/wtl/all/test_v1_package/conanfile.py diff --git a/recipes/wtl/all/conandata.yml b/recipes/wtl/all/conandata.yml index ff81fe89a2bae..1062fb5eccd19 100644 --- a/recipes/wtl/all/conandata.yml +++ b/recipes/wtl/all/conandata.yml @@ -1,7 +1,11 @@ sources: - "9.1.5321": - url: "https://iweb.dl.sourceforge.net/project/wtl/WTL%209.1/WTL%209.1.5321%20Final/WTL91_5321_Final.zip" - sha256: "c03f80c66f28e86b3cc7c98d14afab6bec8eb9366476f6bdda8469c35f52b18a" "10.0.9163": - url: "https://iweb.dl.sourceforge.net/project/wtl/WTL%2010/WTL%2010.0.9163/WTL10_9163.zip" + url: + - "https://master.dl.sourceforge.net/project/wtl/WTL%2010/WTL%2010.0.9163/WTL10_9163.zip" + - "https://iweb.dl.sourceforge.net/project/wtl/WTL%2010/WTL%2010.0.9163/WTL10_9163.zip" sha256: "b9fff11c36532c5fa0114b3c7ee4f752cbef71c7ddfd2e5f88f6f51f15431104" + "9.1.5321": + url: + - "https://master.dl.sourceforge.net/project/wtl/WTL%209.1/WTL%209.1.5321%20Final/WTL91_5321_Final.zip" + - "https://iweb.dl.sourceforge.net/project/wtl/WTL%209.1/WTL%209.1.5321%20Final/WTL91_5321_Final.zip" + sha256: "c03f80c66f28e86b3cc7c98d14afab6bec8eb9366476f6bdda8469c35f52b18a" diff --git a/recipes/wtl/all/conanfile.py b/recipes/wtl/all/conanfile.py index 7f344d54b158c..31f78cb05551e 100644 --- a/recipes/wtl/all/conanfile.py +++ b/recipes/wtl/all/conanfile.py @@ -1,24 +1,45 @@ -from conans import ConanFile, tools +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout import os +required_conan_version = ">=1.54.0" + class WTLConan(ConanFile): name = "wtl" + description = "Windows Template Library (WTL) is a C++ library for developing Windows applications and UI components." license = "MS-PL" url = "https://github.com/conan-io/conan-center-index" homepage = "https://sourceforge.net/projects/wtl" - description = "Windows Template Library (WTL) is a C++ library for developing Windows applications and UI components." - topics = ("atl", "template library", "windows", "template", "ui", "gdi") + topics = ("atl", "template library", "windows", "template", "ui", "gdi", "header-only") - settings = {'os': ['Windows']} + settings = "os" no_copy_source = True + package_type = "header-library" + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.os != "Windows": + raise ConanInvalidConfiguration(f"{self.ref} can only be used on Windows.") + def source(self): - tools.get(**self.conan_data["sources"][self.version]) + get(self, **self.conan_data["sources"][self.version]) + + def build(self): + pass def package(self): - self.copy("*", dst="include", src=os.path.join(self.source_folder, "include")) - self.copy("MS-PL.TXT", dst="licenses", src=self.source_folder) + copy(self, "MS-PL.TXT", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "*", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) - def package_id(self): - self.info.header_only() + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/wtl/all/test_package/CMakeLists.txt b/recipes/wtl/all/test_package/CMakeLists.txt index ca6cdfccb74dd..7c87cbcfbe53b 100644 --- a/recipes/wtl/all/test_package/CMakeLists.txt +++ b/recipes/wtl/all/test_package/CMakeLists.txt @@ -1,10 +1,8 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package CXX) +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(wtl REQUIRED CONFIG) add_executable(${PROJECT_NAME} example.cpp) -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) - -conan_target_link_libraries(${PROJECT_NAME}) +target_link_libraries(${PROJECT_NAME} PRIVATE wtl::wtl) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/wtl/all/test_package/conanfile.py b/recipes/wtl/all/test_package/conanfile.py index bf31d11585919..48499fa0989d9 100644 --- a/recipes/wtl/all/test_package/conanfile.py +++ b/recipes/wtl/all/test_package/conanfile.py @@ -1,10 +1,20 @@ -from conans import ConanFile, CMake, tools - +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os -class WTLTestConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake" + +# It will become the standard on Conan 2.x +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -12,6 +22,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self.settings): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/wtl/all/test_v1_package/CMakeLists.txt b/recipes/wtl/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..9d54a092e0a67 --- /dev/null +++ b/recipes/wtl/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/wtl/all/test_v1_package/conanfile.py b/recipes/wtl/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..c492184eec19c --- /dev/null +++ b/recipes/wtl/all/test_v1_package/conanfile.py @@ -0,0 +1,19 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +# legacy validation with Conan 1.x +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) From b07333418d9ed0d51a2b025571b305fee7448077 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Sat, 29 Apr 2023 04:25:35 +0200 Subject: [PATCH 25/34] (#16281) tesseract: bump dependencies + modernize more for conan v2 * modernize more * bump libcurl * bump libcurl * avoid to depend on leptonica in test package --- recipes/tesseract/all/conanfile.py | 98 +++++++++---------- .../all/test_package/test_package.cpp | 10 +- 2 files changed, 51 insertions(+), 57 deletions(-) diff --git a/recipes/tesseract/all/conanfile.py b/recipes/tesseract/all/conanfile.py index 347299bc98164..bbdcc2c253a14 100644 --- a/recipes/tesseract/all/conanfile.py +++ b/recipes/tesseract/all/conanfile.py @@ -1,14 +1,15 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rmdir, save -from conan.tools.build import cross_building from conan.tools.scm import Version -from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout import os import textwrap -required_conan_version = ">=1.53.0" +required_conan_version = ">=1.54.0" + class TesseractConan(ConanFile): name = "tesseract" @@ -18,6 +19,7 @@ class TesseractConan(ConanFile): homepage = "https://github.com/tesseract-ocr/tesseract" topics = ("ocr", "image", "multimedia", "graphics") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -38,6 +40,29 @@ class TesseractConan(ConanFile): "with_libarchive": True, } + @property + def _min_cppstd(self): + return "11" if Version(self.version) < "5.0.0" else "17" + + @property + def _compilers_minimum_version(self): + return { + "11": { + "Visual Studio": "14", + "msvc": "190", + "gcc": "5", + "clang": "5", + "apple-clang": "6", + }, + "17": { + "Visual Studio": "16", + "msvc": "192", + "gcc": "7", + "clang": "7", + "apple-clang": "11", + }, + }.get(self._min_cppstd, {}) + def export_sources(self): export_conandata_patches(self) @@ -51,9 +76,6 @@ def config_options(self): def configure(self): if self.options.shared: self.options.rm_safe("fPIC") - if self.options.with_training: - # do not enforce failure and allow user to build with system cairo, pango, fontconfig - self.output.warn("*** Build with training is not yet supported, continue on your own") def layout(self): cmake_layout(self, src_folder="src") @@ -65,35 +87,21 @@ def requirements(self): self.requires("libarchive/3.6.2") # libcurl is not required for 4.x if self.options.get_safe("with_libcurl", default=False): - self.requires("libcurl/7.86.0") + self.requires("libcurl/8.0.1") def validate(self): - # Check compiler version - compiler = str(self.settings.compiler) - compiler_version = Version(self.settings.compiler.version.value) + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) - if Version(self.version) >= "5.0.0": - # 5.0.0 requires C++-17 compiler - minimal_version = { - "Visual Studio": "16", - "msvc": "192", - "gcc": "7", - "clang": "7", - "apple-clang": "11" - } - else: - minimal_version = { - "Visual Studio": "14", - "msvc": "190", - "gcc": "5", - "clang": "5", - "apple-clang": "6" - } - if compiler not in minimal_version: - self.output.warn( - "%s recipe lacks information about the %s compiler standard version support" % (self.name, compiler)) - elif compiler_version < minimal_version[compiler]: - raise ConanInvalidConfiguration(f"{self.ref} requires a {compiler} version >= {minimal_version[compiler]}, but {compiler_version} was found") + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + + if self.options.with_training: + # do not enforce failure and allow user to build with system cairo, pango, fontconfig + self.output.warning("*** Build with training is not yet supported, continue on your own") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -118,20 +126,11 @@ def generate(self): tc.variables["AUTO_OPTIMIZE"] = self.options.with_auto_optimize # Set Leptonica_DIR to ensure that find_package will be called in original CMake file - tc.variables["Leptonica_DIR"] = self.deps_cpp_info["leptonica"].rootpath.replace("\\", "/") + tc.variables["Leptonica_DIR"] = self.dependencies["leptonica"].package_folder.replace("\\", "/") if Version(self.version) >= "5.0.0": tc.variables["DISABLE_CURL"] = not self.options.with_libcurl tc.variables["DISABLE_ARCHIVE"] = not self.options.with_libarchive - - if cross_building(self): - cmake_system_processor = { - "armv8": "aarch64", - "armv8.3": "aarch64", - }.get(str(self.settings.arch), str(self.settings.arch)) - tc.cache_variables["CMAKE_SYSTEM_PROCESSOR"] = cmake_system_processor - - tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" tc.generate() deps = CMakeDeps(self) @@ -161,17 +160,17 @@ def package(self): def _create_cmake_module_alias_targets(self, module_file, targets): content = "" for alias, aliased in targets.items(): - content += textwrap.dedent("""\ + content += textwrap.dedent(f"""\ if(TARGET {aliased} AND NOT TARGET {alias}) add_library({alias} INTERFACE IMPORTED) set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) endif() - """.format(alias=alias, aliased=aliased)) + """) save(self, module_file, content) @property def _module_file_rel_path(self): - return os.path.join("lib", "cmake", "conan-official-{}-targets.cmake".format(self.name)) + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") def package_info(self): # Official CMake imported target is: @@ -197,10 +196,6 @@ def package_info(self): elif self.settings.os == "Windows": self.cpp_info.components["libtesseract"].system_libs = ["ws2_32"] - bin_path = os.path.join(self.package_folder, "bin") - self.output.info("Appending PATH environment variable: {}".format(bin_path)) - self.env_info.PATH.append(bin_path) - # TODO: to remove in conan v2 once cmake_find_package* & pkg_config generators removed self.cpp_info.names["cmake_find_package"] = "Tesseract" self.cpp_info.names["cmake_find_package_multi"] = "Tesseract" @@ -209,13 +204,14 @@ def package_info(self): self.cpp_info.components["libtesseract"].build_modules["cmake_find_package"] = [self._module_file_rel_path] self.cpp_info.components["libtesseract"].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] self.cpp_info.components["libtesseract"].set_property("pkg_config_name", "tesseract") + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) @property def _libname(self): suffix = "" if self.settings.os == "Windows": v = Version(self.version) - suffix += "{}{}".format(v.major, v.minor) + suffix += f"{v.major}{v.minor}" if self.settings.build_type == "Debug": suffix += "d" - return "tesseract" + suffix + return f"tesseract{suffix}" diff --git a/recipes/tesseract/all/test_package/test_package.cpp b/recipes/tesseract/all/test_package/test_package.cpp index c7c20b350dbbc..347eb5141c4c3 100644 --- a/recipes/tesseract/all/test_package/test_package.cpp +++ b/recipes/tesseract/all/test_package/test_package.cpp @@ -1,11 +1,9 @@ -#include -#include #include +#include + int main(int argc, char **argv) { - printf("Tesseract version: %s\n", tesseract::TessBaseAPI::Version()); - printf("Leptonica version: %d.%d.%d\n", LIBLEPT_MAJOR_VERSION, LIBLEPT_MINOR_VERSION, LIBLEPT_PATCH_VERSION); - printf("Lib versions: %s\n", getImagelibVersions()); - return 0; + printf("Tesseract version: %s\n", tesseract::TessBaseAPI::Version()); + return 0; } From 2a321c7a488ef31dd58235373359ac09e5fd4653 Mon Sep 17 00:00:00 2001 From: "Huang, Zhaoquan" Date: Sat, 29 Apr 2023 11:06:25 +0800 Subject: [PATCH 26/34] (#14940) libnice: add recipe * libnice: add recipe * libnice: move to v2 version of cross_building * libnice: remove unused imports * libnice: supports the feature toggles * libnice: requires meson when building test package * libnice: apply env to allow executing meson * libnice: force to find OpenSSL by pkg-config * libnice: move to OpenSSL 1.1.1s * libnice: add glib in build_requirements to provide glib-mkenums * libnice: apply suggestions from code review Co-authored-by: Uilian Ries * libnice: fix syntax * libnice: add v1 test package * libnice: change test packages to use CMake instead of Meson * libnice: bump dependencies * libnice: avoid static runtime and shared glib * libnice: bump version to 0.1.21 * Apply suggestions from code review Co-authored-by: Uilian Ries * libnice: remove pdb from package * Apply suggestions from code review Co-authored-by: Chris Mc * Use can_run instead of cross_building --------- Co-authored-by: Uilian Ries Co-authored-by: Chris Mc --- recipes/libnice/all/conandata.yml | 4 + recipes/libnice/all/conanfile.py | 114 ++++++++++++++++++ .../libnice/all/test_package/CMakeLists.txt | 7 ++ recipes/libnice/all/test_package/conanfile.py | 27 +++++ .../libnice/all/test_package/src/example.c | 7 ++ .../all/test_v1_package/CMakeLists.txt | 8 ++ .../libnice/all/test_v1_package/conanfile.py | 19 +++ recipes/libnice/config.yml | 3 + 8 files changed, 189 insertions(+) create mode 100644 recipes/libnice/all/conandata.yml create mode 100644 recipes/libnice/all/conanfile.py create mode 100644 recipes/libnice/all/test_package/CMakeLists.txt create mode 100644 recipes/libnice/all/test_package/conanfile.py create mode 100644 recipes/libnice/all/test_package/src/example.c create mode 100644 recipes/libnice/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libnice/all/test_v1_package/conanfile.py create mode 100644 recipes/libnice/config.yml diff --git a/recipes/libnice/all/conandata.yml b/recipes/libnice/all/conandata.yml new file mode 100644 index 0000000000000..603d8d4fc1235 --- /dev/null +++ b/recipes/libnice/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + 0.1.21: + url: https://libnice.freedesktop.org/releases/libnice-0.1.21.tar.gz + sha256: 72e73a2acf20f59093e21d5601606e405873503eb35f346fa621de23e99b3b39 diff --git a/recipes/libnice/all/conanfile.py b/recipes/libnice/all/conanfile.py new file mode 100644 index 0000000000000..5fd9fcdbbc036 --- /dev/null +++ b/recipes/libnice/all/conanfile.py @@ -0,0 +1,114 @@ +import os +from conan import ConanFile +from conan.tools.meson import Meson, MesonToolchain +from conan.tools.files import copy, get, rmdir, rename, chdir, rm +from conan.tools.layout import basic_layout +from conan.tools.gnu import PkgConfigDeps +from conan.tools.microsoft import is_msvc_static_runtime +from conan.errors import ConanInvalidConfiguration + + +class LibniceConan(ConanFile): + name = "libnice" + homepage = "https://libnice.freedesktop.org/" + license = ("MPL-1.1", "LGPL-2.1-only") + url = "https://github.com/conan-io/conan-center-index" + description = "a GLib ICE implementation" + topics = ("ice", "stun", "turn") + package_type = "library" + settings = "os", "compiler", "build_type", "arch" + options = { + "shared": [True, False], + "fPIC": [True, False], + "crypto_library": ["openssl", "win32"], + "with_gstreamer": [True, False], + "with_gtk_doc": [True, False], + "with_introspection": [True, False]} + default_options = { + "shared": False, + "fPIC": True, + "with_gstreamer": False, + "with_gtk_doc": False, + "with_introspection": False} + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + self.options.crypto_library = "win32" + else: + self.options.crypto_library = "openssl" + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + basic_layout(self, src_folder="src") + + def validate(self): + if self.settings.os != "Windows" and self.options.crypto_library == "win32": + raise ConanInvalidConfiguration( + f"-o {self.ref}:crypto_library=win32 is not supported on non-Windows") + if self.settings.os == "Windows" and self.options.with_gtk_doc: + raise ConanInvalidConfiguration( + f"-o {self.ref}:with_gtk_doc=True is not support on Windows") + if is_msvc_static_runtime(self) and self.dependencies["glib"].options.shared: + raise ConanInvalidConfiguration( + "-o glib/*:shared=True with static runtime is not supported") + + def requirements(self): + self.requires("glib/2.75.2") + if self.options.crypto_library == "openssl": + self.requires("openssl/1.1.1t") + if self.options.with_gstreamer: + self.requires("gstreamer/1.19.2") + + def build_requirements(self): + self.tool_requires("meson/1.0.0") + self.tool_requires("pkgconf/1.9.3") + self.tool_requires("glib/2.75.2") # for glib-mkenums + if self.options.with_introspection: + self.tool_requires("gobject-introspection/1.72.0") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = PkgConfigDeps(self) + tc.generate() + tc = MesonToolchain(self) + tc.project_options["gupnp"] = "disabled" + tc.project_options["gstreamer"] = "enabled" if self.options.with_gstreamer else "disabled" + tc.project_options["crypto-library"] = "auto" if self.options.crypto_library == "win32" else str( + self.options.crypto_library) + + tc.project_options["examples"] = "disabled" + tc.project_options["tests"] = "disabled" + tc.project_options["gtk_doc"] = "disabled" if self.options.with_gtk_doc else "disabled" + tc.project_options["introspection"] = "enabled" if self.options.with_introspection else "disabled" + tc.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) + meson = Meson(self) + meson.install() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rm(self, "*.pdb", os.path.join(self.package_folder, "lib")) + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) + if self.settings.os == "Windows": + if not self.options.shared: + with chdir(self, os.path.join(self.package_folder, "lib")): + rename(self, "libnice.a", "nice.lib") + + def package_info(self): + self.cpp_info.libs = ["nice"] + if self.settings.os == "Windows": + self.cpp_info.system_libs.append("advapi32") diff --git a/recipes/libnice/all/test_package/CMakeLists.txt b/recipes/libnice/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..d61c442b074a4 --- /dev/null +++ b/recipes/libnice/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(example LANGUAGES C) + +find_package(libnice REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} src/example.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libnice::libnice) diff --git a/recipes/libnice/all/test_package/conanfile.py b/recipes/libnice/all/test_package/conanfile.py new file mode 100644 index 0000000000000..22dd4e9d14ebe --- /dev/null +++ b/recipes/libnice/all/test_package/conanfile.py @@ -0,0 +1,27 @@ +import os +from conan import ConanFile +from conan.tools.cmake import CMake +from conan.tools.layout import cmake_layout +from conan.tools.build import can_run + + +class LibniceTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def layout(self): + cmake_layout(self) + + def test(self): + if can_run(self): + cmd = os.path.join(self.cpp.build.bindirs[0], "example") + self.run(cmd, env="conanrun") diff --git a/recipes/libnice/all/test_package/src/example.c b/recipes/libnice/all/test_package/src/example.c new file mode 100644 index 0000000000000..de04a569af0f5 --- /dev/null +++ b/recipes/libnice/all/test_package/src/example.c @@ -0,0 +1,7 @@ +#include + +int main() +{ + NiceAgent *agent = nice_agent_new(NULL, NICE_COMPATIBILITY_RFC5245); + g_object_unref(agent); +} diff --git a/recipes/libnice/all/test_v1_package/CMakeLists.txt b/recipes/libnice/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/libnice/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/libnice/all/test_v1_package/conanfile.py b/recipes/libnice/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..8c9580d2d52b2 --- /dev/null +++ b/recipes/libnice/all/test_v1_package/conanfile.py @@ -0,0 +1,19 @@ +import os +from conan import ConanFile +from conans import CMake +from conan.tools.build import can_run + + +class LibniceTestConan(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 can_run(self): + bin_path = os.path.join("bin", "example") + self.run(bin_path, run_environment=True) diff --git a/recipes/libnice/config.yml b/recipes/libnice/config.yml new file mode 100644 index 0000000000000..68b088642e3c7 --- /dev/null +++ b/recipes/libnice/config.yml @@ -0,0 +1,3 @@ +versions: + "0.1.21": + folder: all From 0f5a9908128021f7081dd99302e70558aaeef4d3 Mon Sep 17 00:00:00 2001 From: KGrzeg Date: Sat, 29 Apr 2023 05:27:27 +0200 Subject: [PATCH 27/34] (#14329) libb64: Add version 2.0.0.1 (a new recipe) * libb64: add recipe * Fixed issues detected by cci hook * Format the code * Remove unused import * Typo in example code * Add options to the package * Apply suggestions from code review Co-authored-by: Piotr Gaczkowski * Renamed libb64 to b64 * Removed package_id method * Removed CXX settings * Manage fPIC flag * Changed shared to static * Common code style * Swap cmake to autotools * MSVC for Windows * add cmake support Signed-off-by: Uilian Ries * add patch for windows Signed-off-by: Uilian Ries * fix append path Signed-off-by: Uilian Ries * Add patches list to conandata.yml * build on GCC5 Signed-off-by: Uilian Ries --------- Signed-off-by: Uilian Ries Co-authored-by: Piotr Gaczkowski Co-authored-by: Uilian Ries --- recipes/b64/all/CMakeLists.txt | 23 ++++ recipes/b64/all/conandata.yml | 20 +++ recipes/b64/all/conanfile.py | 65 ++++++++++ .../b64/all/patches/0001-windows-elseif.patch | 13 ++ recipes/b64/all/patches/0002-extern-c.patch | 117 ++++++++++++++++++ .../b64/all/patches/0003-stdlib-exit.patch | 57 +++++++++ .../b64/all/patches/0004-include-order.patch | 22 ++++ recipes/b64/all/test_package/CMakeLists.txt | 8 ++ recipes/b64/all/test_package/conanfile.py | 26 ++++ recipes/b64/all/test_package/test_package.cpp | 26 ++++ .../b64/all/test_v1_package/CMakeLists.txt | 8 ++ recipes/b64/all/test_v1_package/conanfile.py | 18 +++ recipes/b64/config.yml | 3 + 13 files changed, 406 insertions(+) create mode 100644 recipes/b64/all/CMakeLists.txt create mode 100644 recipes/b64/all/conandata.yml create mode 100755 recipes/b64/all/conanfile.py create mode 100644 recipes/b64/all/patches/0001-windows-elseif.patch create mode 100644 recipes/b64/all/patches/0002-extern-c.patch create mode 100644 recipes/b64/all/patches/0003-stdlib-exit.patch create mode 100644 recipes/b64/all/patches/0004-include-order.patch create mode 100644 recipes/b64/all/test_package/CMakeLists.txt create mode 100644 recipes/b64/all/test_package/conanfile.py create mode 100644 recipes/b64/all/test_package/test_package.cpp create mode 100644 recipes/b64/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/b64/all/test_v1_package/conanfile.py create mode 100644 recipes/b64/config.yml diff --git a/recipes/b64/all/CMakeLists.txt b/recipes/b64/all/CMakeLists.txt new file mode 100644 index 0000000000000..86ec29f0103b2 --- /dev/null +++ b/recipes/b64/all/CMakeLists.txt @@ -0,0 +1,23 @@ +cmake_minimum_required(VERSION 3.15) +project(b64 LANGUAGES C CXX) + +file(GLOB HEADER_FILES "${CMAKE_CURRENT_SOURCE_DIR}/src/include/b64/*.h") +add_library(${PROJECT_NAME} "${CMAKE_CURRENT_SOURCE_DIR}/src/src/cdecode.c" "${CMAKE_CURRENT_SOURCE_DIR}/src/src/cencode.c" ${HEADER_FILES}) +target_include_directories(${PROJECT_NAME} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/src/include") +set_target_properties(${PROJECT_NAME} PROPERTIES PUBLIC_HEADER "${HEADER_FILES}" WINDOWS_EXPORT_ALL_SYMBOLS TRUE) +install(TARGETS ${PROJECT_NAME} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/b64" +) + +set(BASE64_APP base64) +add_executable(${BASE64_APP} "${CMAKE_CURRENT_SOURCE_DIR}/src/base64/base64.cc" ${HEADER_FILES}) +target_link_libraries(${BASE64_APP} PRIVATE ${PROJECT_NAME}) +target_include_directories(${BASE64_APP} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/src/include") +target_compile_definitions(${BASE64_APP} PRIVATE BUFFERSIZE=16777216) +set_target_properties(${BASE64_APP} PROPERTIES LINKER_LANGUAGE CXX) +install(TARGETS ${BASE64_APP} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} +) diff --git a/recipes/b64/all/conandata.yml b/recipes/b64/all/conandata.yml new file mode 100644 index 0000000000000..6f62323cd1501 --- /dev/null +++ b/recipes/b64/all/conandata.yml @@ -0,0 +1,20 @@ +sources: + "2.0.0.1": + url: "https://github.com/libb64/libb64/archive/refs/tags/v2.0.0.1.tar.gz" + sha256: "ce8e578a953a591bd4a6f157eec310b9a4c2e6f10ade2fdda6ae6bafaf798b98" +patches: + "2.0.0.1": + - patch_file: "patches/0001-windows-elseif.patch" + patch_description: "Replace elseif definition by elif to make it work on Windows" + patch_type: "portability" + patch_source: "https://github.com/libb64/libb64/commit/b5edeafc89853c48fa41a4c16393a1fdc8638ab6" + - patch_file: "patches/0002-extern-c.patch" + patch_description: "Move extern C from C++ headers to C headers" + patch_type: "portability" + patch_source: "https://github.com/libb64/libb64/pull/6/commits/502573666a61317aa6bee2ff9ab74e65a7c25f63" + - patch_file: "patches/0003-stdlib-exit.patch" + patch_description: "Use cstdlib instead of stdlib.h for exit() - needed for GCC5" + patch_type: "conan" + - patch_file: "patches/0004-include-order.patch" + patch_description: "Include C headers first, than C++ headers, and project headers" + patch_type: "conan" diff --git a/recipes/b64/all/conanfile.py b/recipes/b64/all/conanfile.py new file mode 100755 index 0000000000000..bdc200c525d02 --- /dev/null +++ b/recipes/b64/all/conanfile.py @@ -0,0 +1,65 @@ +from conan import ConanFile +from conan.tools.files import get, copy, export_conandata_patches, apply_conandata_patches +from conan.tools.cmake import cmake_layout, CMakeToolchain, CMake +import os + + +required_conan_version = ">=1.53.0" + + +class B64Conan(ConanFile): + name = "b64" + description = "A library of ANSI C routines for fast encoding/decoding data into and from a base64-encoded format." + license = "CC0-1.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://libb64.sourceforge.net/" + topics = ("base64", "codec", "encoder", "decoder") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def export_sources(self): + copy(self, "CMakeLists.txt", src=self.recipe_folder, dst=self.export_sources_folder) + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) + cmake.build() + + def package(self): + copy(self, pattern="LICENSE.md", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) + cmake.install() + + def package_info(self): + self.cpp_info.libs = ["b64"] + + # TODO: Only for Conan 1.x legacy - Remove after running Conan 2.x only + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/b64/all/patches/0001-windows-elseif.patch b/recipes/b64/all/patches/0001-windows-elseif.patch new file mode 100644 index 0000000000000..ab8677906ac76 --- /dev/null +++ b/recipes/b64/all/patches/0001-windows-elseif.patch @@ -0,0 +1,13 @@ +diff --git a/include/b64/ccommon.h b/include/b64/ccommon.h +index 2b614df..28a9936 100644 +--- a/include/b64/ccommon.h ++++ b/include/b64/ccommon.h +@@ -14,7 +14,7 @@ For details, see http://sourceforge.net/projects/libb64 + #ifndef HAVE_SIZE_T + #ifdef _WIN32 + #include +- #elseif defined (__unix__) || (defined (__APPLE__) && defined (__MACH__)) ++ #elif defined (__unix__) || (defined (__APPLE__) && defined (__MACH__)) + #include + #else + typedef unsigned long size_t; diff --git a/recipes/b64/all/patches/0002-extern-c.patch b/recipes/b64/all/patches/0002-extern-c.patch new file mode 100644 index 0000000000000..ad69b157b0f90 --- /dev/null +++ b/recipes/b64/all/patches/0002-extern-c.patch @@ -0,0 +1,117 @@ +diff --git a/include/b64/cdecode.h b/include/b64/cdecode.h +index d6ff24c..889614f 100644 +--- a/include/b64/cdecode.h ++++ b/include/b64/cdecode.h +@@ -13,6 +13,11 @@ For details, see http://sourceforge.net/projects/libb64 + #define BASE64_CDEC_VER_MAJOR 2 + #define BASE64_CDEC_VER_MINOR 0 + ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ + typedef enum + { + step_a, step_b, step_c, step_d +@@ -24,11 +29,15 @@ typedef struct + char plainchar; + } base64_decodestate; + +-extern void base64_init_decodestate(base64_decodestate* state_in); ++void base64_init_decodestate(base64_decodestate* state_in); ++ ++size_t base64_decode_maxlength(size_t encode_len); + +-extern size_t base64_decode_maxlength(size_t encode_len); ++int base64_decode_value(signed char value_in); ++size_t base64_decode_block(const char* code_in, const size_t length_in, void* plaintext_out, base64_decodestate* state_in); + +-extern int base64_decode_value(signed char value_in); +-extern size_t base64_decode_block(const char* code_in, const size_t length_in, void* plaintext_out, base64_decodestate* state_in); ++#ifdef __cplusplus ++} ++#endif + + #endif /* BASE64_CDECODE_H */ +diff --git a/include/b64/cencode.h b/include/b64/cencode.h +index 96b0cdb..9b70877 100644 +--- a/include/b64/cencode.h ++++ b/include/b64/cencode.h +@@ -13,6 +13,11 @@ For details, see http://sourceforge.net/projects/libb64 + #define BASE64_CENC_VER_MAJOR 2 + #define BASE64_CENC_VER_MINOR 0 + ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ + typedef enum + { + step_A, step_B, step_C +@@ -31,12 +36,16 @@ typedef struct + char result; + } base64_encodestate; + +-extern void base64_init_encodestate(base64_encodestate* state_in); ++void base64_init_encodestate(base64_encodestate* state_in); ++ ++size_t base64_encode_length(size_t plain_len, base64_encodestate* state_in); + +-extern size_t base64_encode_length(size_t plain_len, base64_encodestate* state_in); ++char base64_encode_value(signed char value_in); ++size_t base64_encode_block(const void* plaintext_in, const size_t length_in, char* code_out, base64_encodestate* state_in); ++size_t base64_encode_blockend(char* code_out, base64_encodestate* state_in); + +-extern char base64_encode_value(signed char value_in); +-extern size_t base64_encode_block(const void* plaintext_in, const size_t length_in, char* code_out, base64_encodestate* state_in); +-extern size_t base64_encode_blockend(char* code_out, base64_encodestate* state_in); ++#ifdef __cplusplus ++} ++#endif + + #endif /* BASE64_CENCODE_H */ +diff --git a/include/b64/decode.h b/include/b64/decode.h +index b2362e5..bfff27c 100644 +--- a/include/b64/decode.h ++++ b/include/b64/decode.h +@@ -12,10 +12,8 @@ For details, see http://sourceforge.net/projects/libb64 + + namespace base64 + { +- extern "C" +- { +- #include "cdecode.h" +- } ++ ++#include "cdecode.h" + + struct decoder + { +@@ -69,4 +67,3 @@ namespace base64 + + + #endif // BASE64_DECODE_H +- +diff --git a/include/b64/encode.h b/include/b64/encode.h +index c1a5f88..c1c2ead 100644 +--- a/include/b64/encode.h ++++ b/include/b64/encode.h +@@ -12,10 +12,8 @@ For details, see http://sourceforge.net/projects/libb64 + + namespace base64 + { +- extern "C" +- { ++ + #include "cencode.h" +- } + + struct encoder + { +@@ -75,4 +73,3 @@ namespace base64 + } // namespace base64 + + #endif // BASE64_ENCODE_H +- diff --git a/recipes/b64/all/patches/0003-stdlib-exit.patch b/recipes/b64/all/patches/0003-stdlib-exit.patch new file mode 100644 index 0000000000000..0ccb585ce887e --- /dev/null +++ b/recipes/b64/all/patches/0003-stdlib-exit.patch @@ -0,0 +1,57 @@ +diff --git a/base64/base64.cc b/base64/base64.cc +index acab416..f952dc6 100644 +--- a/base64/base64.cc ++++ b/base64/base64.cc +@@ -12,7 +12,7 @@ For details, see http://sourceforge.net/projects/libb64 + #include + #include + +-#include ++#include + + // Function which prints the usage of this executable + void usage() +@@ -38,14 +38,14 @@ int main(int argc, char** argv) + if (argc == 1) + { + usage(); +- exit(-1); ++ std::exit(-1); + } + if (argc != 4) + { + usage("Wrong number of arguments!"); +- exit(-1); ++ std::exit(-1); + } +- ++ + // So far so good; try to open the input file + std::string input = argv[2]; + // Note that we have to open the input in binary mode. +@@ -56,9 +56,9 @@ int main(int argc, char** argv) + if (!instream.is_open()) + { + usage("Could not open input file!"); +- exit(-1); ++ std::exit(-1); + } +- ++ + // Now try to open the output file + std::string output = argv[3]; + // Again, note that we have to open the ouput in binary mode. +@@ -68,7 +68,7 @@ int main(int argc, char** argv) + if (!outstream.is_open()) + { + usage("Could not open output file!"); +- exit(-1); ++ std::exit(-1); + } + + // determine whether we need to encode or decode: +@@ -91,4 +91,3 @@ int main(int argc, char** argv) + + return 0; + } +- diff --git a/recipes/b64/all/patches/0004-include-order.patch b/recipes/b64/all/patches/0004-include-order.patch new file mode 100644 index 0000000000000..b509bb64fb543 --- /dev/null +++ b/recipes/b64/all/patches/0004-include-order.patch @@ -0,0 +1,22 @@ +diff --git a/base64/base64.cc b/base64/base64.cc +index f952dc6..e22abd0 100644 +--- a/base64/base64.cc ++++ b/base64/base64.cc +@@ -5,14 +5,14 @@ This is part of the libb64 project, and has been placed in the public domain. + For details, see http://sourceforge.net/projects/libb64 + */ + +-#include +-#include ++#include + + #include + #include + #include + +-#include ++#include ++#include + + // Function which prints the usage of this executable + void usage() diff --git a/recipes/b64/all/test_package/CMakeLists.txt b/recipes/b64/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..21db2d93d4c6c --- /dev/null +++ b/recipes/b64/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) + +project(test_package CXX) + +find_package(b64 REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE b64::b64) diff --git a/recipes/b64/all/test_package/conanfile.py b/recipes/b64/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/b64/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/b64/all/test_package/test_package.cpp b/recipes/b64/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..32696bbbcfe1a --- /dev/null +++ b/recipes/b64/all/test_package/test_package.cpp @@ -0,0 +1,26 @@ +#include + +extern "C" { + #include "b64/cencode.h" + #include "b64/cdecode.h" +} + +int main() { + const char str[] = "Hello world!"; + const unsigned len = sizeof(str); + char out[len*2] = {0}, rev[len*2] = {0}; + + base64_encodestate E; + base64_init_encodestate(&E); + base64_decodestate D; + base64_init_decodestate(&D); + + const unsigned out_len = base64_encode_block(str, len, out, &E); + base64_decode_block(out, out_len, rev, &D); + + std::cout << "input: " << str << std::endl; + std::cout << "base64: " << out << std::endl; + std::cout << "reversed: " << rev << std::endl; + + return 0; +} diff --git a/recipes/b64/all/test_v1_package/CMakeLists.txt b/recipes/b64/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/b64/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/b64/all/test_v1_package/conanfile.py b/recipes/b64/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/b64/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/b64/config.yml b/recipes/b64/config.yml new file mode 100644 index 0000000000000..db58b29f8bd29 --- /dev/null +++ b/recipes/b64/config.yml @@ -0,0 +1,3 @@ +versions: + "2.0.0.1": + folder: all From 3b74fcb38700ce4120313161e92e6a68f7108cf2 Mon Sep 17 00:00:00 2001 From: Samuel Dowling Date: Sat, 29 Apr 2023 18:12:33 +0930 Subject: [PATCH 28/34] (#17296) [armadillo] Bump dependencies * Bump dependency versions and fix output to ensure conan 2.0 compatibility --- recipes/armadillo/all/conanfile.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/recipes/armadillo/all/conanfile.py b/recipes/armadillo/all/conanfile.py index 698da802b3b8f..4c814b3794dad 100644 --- a/recipes/armadillo/all/conanfile.py +++ b/recipes/armadillo/all/conanfile.py @@ -146,7 +146,7 @@ def validate(self): ) for opt in deprecated_opts: - self.output.warn( + self.output.warning( f"DEPRECATION NOTICE: Value {opt} uses armadillo's default dependency search and will be replaced when this package becomes available in ConanCenter" ) @@ -165,10 +165,10 @@ def requirements(self): if self.options.use_hdf5: # Use the conan dependency if the system lib isn't being used - self.requires("hdf5/1.12.0") + self.requires("hdf5/1.14.0") if self.options.use_blas == "openblas": - self.requires("openblas/0.3.15") + self.requires("openblas/0.3.20") # Note that if you're relying on this to build LAPACK, you _must_ have # a fortran compiler installed. If you don't, OpenBLAS will build successfully but # without LAPACK support, which isn't obvious. @@ -187,7 +187,7 @@ def requirements(self): self.options.use_blas == "intel_mkl" or self.options.use_lapack == "intel_mkl" ): - self.output.warn( + self.output.warning( "The intel-mkl package does not exist in CCI. To use an Intel MKL package, override this requirement with your own recipe." ) self.requires("intel-mkl/2021.4") From e8531b6892e44e7671a7081a8975d7c845905924 Mon Sep 17 00:00:00 2001 From: toge Date: Sat, 29 Apr 2023 18:21:55 +0900 Subject: [PATCH 29/34] (#17294) cpu_features: add version 0.8.0, add package_type --- recipes/cpu_features/all/conandata.yml | 13 + recipes/cpu_features/all/conanfile.py | 5 +- .../0.8.0-0001-support-aarch64-macos.patch | 257 ++++++++++++++++++ recipes/cpu_features/config.yml | 2 + 4 files changed, 274 insertions(+), 3 deletions(-) create mode 100644 recipes/cpu_features/all/patches/0.8.0-0001-support-aarch64-macos.patch diff --git a/recipes/cpu_features/all/conandata.yml b/recipes/cpu_features/all/conandata.yml index a6a49730a3d42..8e0a68b98fb04 100644 --- a/recipes/cpu_features/all/conandata.yml +++ b/recipes/cpu_features/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.8.0": + url: "https://github.com/google/cpu_features/archive/refs/tags/v0.8.0.tar.gz" + sha256: "7021729f2db97aa34f218d12727314f23e8b11eaa2d5a907e8426bcb41d7eaac" "0.7.0": url: "https://github.com/google/cpu_features/archive/refs/tags/v0.7.0.tar.gz" sha256: "df80d9439abf741c7d2fdcdfd2d26528b136e6c52976be8bd0cd5e45a27262c0" @@ -6,7 +9,17 @@ sources: url: "https://github.com/google/cpu_features/archive/refs/tags/v0.6.0.tar.gz" sha256: "95a1cf6f24948031df114798a97eea2a71143bd38a4d07d9a758dda3924c1932" patches: + "0.8.0": + - patch_file: "patches/0.8.0-0001-support-aarch64-macos.patch" + patch_description: "support M1 MacOSX" + patch_type: "portability" + patch_source: "https://github.com/google/cpu_features/pull/204" "0.7.0": - patch_file: "patches/0.7.0-0001-support-aarch64-macos.patch" + patch_description: "support M1 MacOSX" + patch_type: "portability" + patch_source: "https://github.com/google/cpu_features/pull/204" "0.6.0": - patch_file: "patches/0.6.0-0001-fix-bundle-install.patch" + patch_description: "add bundle destination to install" + patch_type: "conan" diff --git a/recipes/cpu_features/all/conanfile.py b/recipes/cpu_features/all/conanfile.py index 67333f1731762..704de6e4661e1 100644 --- a/recipes/cpu_features/all/conanfile.py +++ b/recipes/cpu_features/all/conanfile.py @@ -15,7 +15,7 @@ class CpuFeaturesConan(ConanFile): homepage = "https://github.com/google/cpu_features" description = "A cross platform C99 library to get cpu features at runtime." topics = ("cpu", "features", "cpuid") - + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -43,8 +43,7 @@ def layout(self): cmake_layout(self, src_folder="src") def source(self): - get(self, **self.conan_data["sources"][self.version], - destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): tc = CMakeToolchain(self) diff --git a/recipes/cpu_features/all/patches/0.8.0-0001-support-aarch64-macos.patch b/recipes/cpu_features/all/patches/0.8.0-0001-support-aarch64-macos.patch new file mode 100644 index 0000000000000..e29b90d0379c1 --- /dev/null +++ b/recipes/cpu_features/all/patches/0.8.0-0001-support-aarch64-macos.patch @@ -0,0 +1,257 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index bcc9bb0..c87475c 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -147,7 +147,7 @@ target_link_libraries(cpu_features PUBLIC ${CMAKE_DL_LIBS}) + target_include_directories(cpu_features + PUBLIC $ + ) +-if(PROCESSOR_IS_X86) ++if(PROCESSOR_IS_X86 OR PROCESSOR_IS_AARCH64) + if(APPLE) + target_compile_definitions(cpu_features PRIVATE HAVE_SYSCTLBYNAME) + endif() +diff --git b/include/impl_aarch64__base_implementation.inl b/include/impl_aarch64__base_implementation.inl +new file mode 100644 +index 0000000..ef3629e +--- /dev/null ++++ b/include/impl_aarch64__base_implementation.inl +@@ -0,0 +1,63 @@ ++#include "cpuinfo_aarch64.h" ++ ++//////////////////////////////////////////////////////////////////////////////// ++// Definitions for introspection. ++//////////////////////////////////////////////////////////////////////////////// ++#define INTROSPECTION_TABLE \ ++ LINE(AARCH64_FP, fp, "fp", AARCH64_HWCAP_FP, 0) \ ++ LINE(AARCH64_ASIMD, asimd, "asimd", AARCH64_HWCAP_ASIMD, 0) \ ++ LINE(AARCH64_EVTSTRM, evtstrm, "evtstrm", AARCH64_HWCAP_EVTSTRM, 0) \ ++ LINE(AARCH64_AES, aes, "aes", AARCH64_HWCAP_AES, 0) \ ++ LINE(AARCH64_PMULL, pmull, "pmull", AARCH64_HWCAP_PMULL, 0) \ ++ LINE(AARCH64_SHA1, sha1, "sha1", AARCH64_HWCAP_SHA1, 0) \ ++ LINE(AARCH64_SHA2, sha2, "sha2", AARCH64_HWCAP_SHA2, 0) \ ++ LINE(AARCH64_CRC32, crc32, "crc32", AARCH64_HWCAP_CRC32, 0) \ ++ LINE(AARCH64_ATOMICS, atomics, "atomics", AARCH64_HWCAP_ATOMICS, 0) \ ++ LINE(AARCH64_FPHP, fphp, "fphp", AARCH64_HWCAP_FPHP, 0) \ ++ LINE(AARCH64_ASIMDHP, asimdhp, "asimdhp", AARCH64_HWCAP_ASIMDHP, 0) \ ++ LINE(AARCH64_CPUID, cpuid, "cpuid", AARCH64_HWCAP_CPUID, 0) \ ++ LINE(AARCH64_ASIMDRDM, asimdrdm, "asimdrdm", AARCH64_HWCAP_ASIMDRDM, 0) \ ++ LINE(AARCH64_JSCVT, jscvt, "jscvt", AARCH64_HWCAP_JSCVT, 0) \ ++ LINE(AARCH64_FCMA, fcma, "fcma", AARCH64_HWCAP_FCMA, 0) \ ++ LINE(AARCH64_LRCPC, lrcpc, "lrcpc", AARCH64_HWCAP_LRCPC, 0) \ ++ LINE(AARCH64_DCPOP, dcpop, "dcpop", AARCH64_HWCAP_DCPOP, 0) \ ++ LINE(AARCH64_SHA3, sha3, "sha3", AARCH64_HWCAP_SHA3, 0) \ ++ LINE(AARCH64_SM3, sm3, "sm3", AARCH64_HWCAP_SM3, 0) \ ++ LINE(AARCH64_SM4, sm4, "sm4", AARCH64_HWCAP_SM4, 0) \ ++ LINE(AARCH64_ASIMDDP, asimddp, "asimddp", AARCH64_HWCAP_ASIMDDP, 0) \ ++ LINE(AARCH64_SHA512, sha512, "sha512", AARCH64_HWCAP_SHA512, 0) \ ++ LINE(AARCH64_SVE, sve, "sve", AARCH64_HWCAP_SVE, 0) \ ++ LINE(AARCH64_ASIMDFHM, asimdfhm, "asimdfhm", AARCH64_HWCAP_ASIMDFHM, 0) \ ++ LINE(AARCH64_DIT, dit, "dit", AARCH64_HWCAP_DIT, 0) \ ++ LINE(AARCH64_USCAT, uscat, "uscat", AARCH64_HWCAP_USCAT, 0) \ ++ LINE(AARCH64_ILRCPC, ilrcpc, "ilrcpc", AARCH64_HWCAP_ILRCPC, 0) \ ++ LINE(AARCH64_FLAGM, flagm, "flagm", AARCH64_HWCAP_FLAGM, 0) \ ++ LINE(AARCH64_SSBS, ssbs, "ssbs", AARCH64_HWCAP_SSBS, 0) \ ++ LINE(AARCH64_SB, sb, "sb", AARCH64_HWCAP_SB, 0) \ ++ LINE(AARCH64_PACA, paca, "paca", AARCH64_HWCAP_PACA, 0) \ ++ LINE(AARCH64_PACG, pacg, "pacg", AARCH64_HWCAP_PACG, 0) \ ++ LINE(AARCH64_DCPODP, dcpodp, "dcpodp", 0, AARCH64_HWCAP2_DCPODP) \ ++ LINE(AARCH64_SVE2, sve2, "sve2", 0, AARCH64_HWCAP2_SVE2) \ ++ LINE(AARCH64_SVEAES, sveaes, "sveaes", 0, AARCH64_HWCAP2_SVEAES) \ ++ LINE(AARCH64_SVEPMULL, svepmull, "svepmull", 0, AARCH64_HWCAP2_SVEPMULL) \ ++ LINE(AARCH64_SVEBITPERM, svebitperm, "svebitperm", 0, \ ++ AARCH64_HWCAP2_SVEBITPERM) \ ++ LINE(AARCH64_SVESHA3, svesha3, "svesha3", 0, AARCH64_HWCAP2_SVESHA3) \ ++ LINE(AARCH64_SVESM4, svesm4, "svesm4", 0, AARCH64_HWCAP2_SVESM4) \ ++ LINE(AARCH64_FLAGM2, flagm2, "flagm2", 0, AARCH64_HWCAP2_FLAGM2) \ ++ LINE(AARCH64_FRINT, frint, "frint", 0, AARCH64_HWCAP2_FRINT) \ ++ LINE(AARCH64_SVEI8MM, svei8mm, "svei8mm", 0, AARCH64_HWCAP2_SVEI8MM) \ ++ LINE(AARCH64_SVEF32MM, svef32mm, "svef32mm", 0, AARCH64_HWCAP2_SVEF32MM) \ ++ LINE(AARCH64_SVEF64MM, svef64mm, "svef64mm", 0, AARCH64_HWCAP2_SVEF64MM) \ ++ LINE(AARCH64_SVEBF16, svebf16, "svebf16", 0, AARCH64_HWCAP2_SVEBF16) \ ++ LINE(AARCH64_I8MM, i8mm, "i8mm", 0, AARCH64_HWCAP2_I8MM) \ ++ LINE(AARCH64_BF16, bf16, "bf16", 0, AARCH64_HWCAP2_BF16) \ ++ LINE(AARCH64_DGH, dgh, "dgh", 0, AARCH64_HWCAP2_DGH) \ ++ LINE(AARCH64_RNG, rng, "rng", 0, AARCH64_HWCAP2_RNG) \ ++ LINE(AARCH64_BTI, bti, "bti", 0, AARCH64_HWCAP2_BTI) \ ++ LINE(AARCH64_MTE, mte, "mte", 0, AARCH64_HWCAP2_MTE) \ ++ LINE(AARCH64_ECV, ecv, "ecv", 0, AARCH64_HWCAP2_ECV) \ ++ LINE(AARCH64_AFP, afp, "afp", 0, AARCH64_HWCAP2_AFP) \ ++ LINE(AARCH64_RPRES, rpres, "rpres", 0, AARCH64_HWCAP2_RPRES) ++#define INTROSPECTION_PREFIX Aarch64 ++#define INTROSPECTION_ENUM_PREFIX AARCH64 +diff --git a/src/impl_aarch64_linux_or_android.c b/src/impl_aarch64_linux_or_android.c +index ef923d9..c0a764c 100644 +--- a/src/impl_aarch64_linux_or_android.c ++++ b/src/impl_aarch64_linux_or_android.c +@@ -17,81 +17,7 @@ + #ifdef CPU_FEATURES_ARCH_AARCH64 + #if defined(CPU_FEATURES_OS_LINUX) || defined(CPU_FEATURES_OS_ANDROID) + +-#include "cpuinfo_aarch64.h" +- +-//////////////////////////////////////////////////////////////////////////////// +-// Definitions for introspection. +-//////////////////////////////////////////////////////////////////////////////// +-#define INTROSPECTION_TABLE \ +- LINE(AARCH64_FP, fp, "fp", AARCH64_HWCAP_FP, 0) \ +- LINE(AARCH64_ASIMD, asimd, "asimd", AARCH64_HWCAP_ASIMD, 0) \ +- LINE(AARCH64_EVTSTRM, evtstrm, "evtstrm", AARCH64_HWCAP_EVTSTRM, 0) \ +- LINE(AARCH64_AES, aes, "aes", AARCH64_HWCAP_AES, 0) \ +- LINE(AARCH64_PMULL, pmull, "pmull", AARCH64_HWCAP_PMULL, 0) \ +- LINE(AARCH64_SHA1, sha1, "sha1", AARCH64_HWCAP_SHA1, 0) \ +- LINE(AARCH64_SHA2, sha2, "sha2", AARCH64_HWCAP_SHA2, 0) \ +- LINE(AARCH64_CRC32, crc32, "crc32", AARCH64_HWCAP_CRC32, 0) \ +- LINE(AARCH64_ATOMICS, atomics, "atomics", AARCH64_HWCAP_ATOMICS, 0) \ +- LINE(AARCH64_FPHP, fphp, "fphp", AARCH64_HWCAP_FPHP, 0) \ +- LINE(AARCH64_ASIMDHP, asimdhp, "asimdhp", AARCH64_HWCAP_ASIMDHP, 0) \ +- LINE(AARCH64_CPUID, cpuid, "cpuid", AARCH64_HWCAP_CPUID, 0) \ +- LINE(AARCH64_ASIMDRDM, asimdrdm, "asimdrdm", AARCH64_HWCAP_ASIMDRDM, 0) \ +- LINE(AARCH64_JSCVT, jscvt, "jscvt", AARCH64_HWCAP_JSCVT, 0) \ +- LINE(AARCH64_FCMA, fcma, "fcma", AARCH64_HWCAP_FCMA, 0) \ +- LINE(AARCH64_LRCPC, lrcpc, "lrcpc", AARCH64_HWCAP_LRCPC, 0) \ +- LINE(AARCH64_DCPOP, dcpop, "dcpop", AARCH64_HWCAP_DCPOP, 0) \ +- LINE(AARCH64_SHA3, sha3, "sha3", AARCH64_HWCAP_SHA3, 0) \ +- LINE(AARCH64_SM3, sm3, "sm3", AARCH64_HWCAP_SM3, 0) \ +- LINE(AARCH64_SM4, sm4, "sm4", AARCH64_HWCAP_SM4, 0) \ +- LINE(AARCH64_ASIMDDP, asimddp, "asimddp", AARCH64_HWCAP_ASIMDDP, 0) \ +- LINE(AARCH64_SHA512, sha512, "sha512", AARCH64_HWCAP_SHA512, 0) \ +- LINE(AARCH64_SVE, sve, "sve", AARCH64_HWCAP_SVE, 0) \ +- LINE(AARCH64_ASIMDFHM, asimdfhm, "asimdfhm", AARCH64_HWCAP_ASIMDFHM, 0) \ +- LINE(AARCH64_DIT, dit, "dit", AARCH64_HWCAP_DIT, 0) \ +- LINE(AARCH64_USCAT, uscat, "uscat", AARCH64_HWCAP_USCAT, 0) \ +- LINE(AARCH64_ILRCPC, ilrcpc, "ilrcpc", AARCH64_HWCAP_ILRCPC, 0) \ +- LINE(AARCH64_FLAGM, flagm, "flagm", AARCH64_HWCAP_FLAGM, 0) \ +- LINE(AARCH64_SSBS, ssbs, "ssbs", AARCH64_HWCAP_SSBS, 0) \ +- LINE(AARCH64_SB, sb, "sb", AARCH64_HWCAP_SB, 0) \ +- LINE(AARCH64_PACA, paca, "paca", AARCH64_HWCAP_PACA, 0) \ +- LINE(AARCH64_PACG, pacg, "pacg", AARCH64_HWCAP_PACG, 0) \ +- LINE(AARCH64_DCPODP, dcpodp, "dcpodp", 0, AARCH64_HWCAP2_DCPODP) \ +- LINE(AARCH64_SVE2, sve2, "sve2", 0, AARCH64_HWCAP2_SVE2) \ +- LINE(AARCH64_SVEAES, sveaes, "sveaes", 0, AARCH64_HWCAP2_SVEAES) \ +- LINE(AARCH64_SVEPMULL, svepmull, "svepmull", 0, AARCH64_HWCAP2_SVEPMULL) \ +- LINE(AARCH64_SVEBITPERM, svebitperm, "svebitperm", 0, \ +- AARCH64_HWCAP2_SVEBITPERM) \ +- LINE(AARCH64_SVESHA3, svesha3, "svesha3", 0, AARCH64_HWCAP2_SVESHA3) \ +- LINE(AARCH64_SVESM4, svesm4, "svesm4", 0, AARCH64_HWCAP2_SVESM4) \ +- LINE(AARCH64_FLAGM2, flagm2, "flagm2", 0, AARCH64_HWCAP2_FLAGM2) \ +- LINE(AARCH64_FRINT, frint, "frint", 0, AARCH64_HWCAP2_FRINT) \ +- LINE(AARCH64_SVEI8MM, svei8mm, "svei8mm", 0, AARCH64_HWCAP2_SVEI8MM) \ +- LINE(AARCH64_SVEF32MM, svef32mm, "svef32mm", 0, AARCH64_HWCAP2_SVEF32MM) \ +- LINE(AARCH64_SVEF64MM, svef64mm, "svef64mm", 0, AARCH64_HWCAP2_SVEF64MM) \ +- LINE(AARCH64_SVEBF16, svebf16, "svebf16", 0, AARCH64_HWCAP2_SVEBF16) \ +- LINE(AARCH64_I8MM, i8mm, "i8mm", 0, AARCH64_HWCAP2_I8MM) \ +- LINE(AARCH64_BF16, bf16, "bf16", 0, AARCH64_HWCAP2_BF16) \ +- LINE(AARCH64_DGH, dgh, "dgh", 0, AARCH64_HWCAP2_DGH) \ +- LINE(AARCH64_RNG, rng, "rng", 0, AARCH64_HWCAP2_RNG) \ +- LINE(AARCH64_BTI, bti, "bti", 0, AARCH64_HWCAP2_BTI) \ +- LINE(AARCH64_MTE, mte, "mte", 0, AARCH64_HWCAP2_MTE) \ +- LINE(AARCH64_ECV, ecv, "ecv", 0, AARCH64_HWCAP2_ECV) \ +- LINE(AARCH64_AFP, afp, "afp", 0, AARCH64_HWCAP2_AFP) \ +- LINE(AARCH64_RPRES, rpres, "rpres", 0, AARCH64_HWCAP2_RPRES) +-#define INTROSPECTION_PREFIX Aarch64 +-#define INTROSPECTION_ENUM_PREFIX AARCH64 +-#include "define_introspection_and_hwcaps.inl" +- +-//////////////////////////////////////////////////////////////////////////////// +-// Implementation. +-//////////////////////////////////////////////////////////////////////////////// +- +-#include +- +-#include "internal/bit_utils.h" +-#include "internal/filesystem.h" +-#include "internal/stack_line_reader.h" +-#include "internal/string_view.h" ++#include "impl_aarch64__base_implementation.inl" + + static bool HandleAarch64Line(const LineResult result, + Aarch64Info* const info) { +diff --git b/src/impl_aarch64_macos_or_iphone.c b/src/impl_aarch64_macos_or_iphone.c +new file mode 100644 +index 0000000..4dd1db7 +--- /dev/null ++++ b/src/impl_aarch64_macos_or_iphone.c +@@ -0,0 +1,82 @@ ++// Copyright 2021 Google LLC ++// ++// Licensed under the Apache License, Version 2.0 (the "License"); ++// you may not use this file except in compliance with the License. ++// You may obtain a copy of the License at ++// ++// http://www.apache.org/licenses/LICENSE-2.0 ++// ++// Unless required by applicable law or agreed to in writing, software ++// distributed under the License is distributed on an "AS IS" BASIS, ++// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++// See the License for the specific language governing permissions and ++// limitations under the License. ++ ++#include "cpu_features_macros.h" ++ ++#ifdef CPU_FEATURES_ARCH_AARCH64 ++#if defined(CPU_FEATURES_OS_MACOS) || defined(CPU_FEATURES_OS_IPHONE) ++ ++#include "impl_aarch64__base_implementation.inl" ++#include "define_introspection_and_hwcaps.inl" ++ ++#if !defined(HAVE_SYSCTLBYNAME) ++#error "Darwin needs support for sysctlbyname" ++#endif ++#include ++ ++#if defined(CPU_FEATURES_MOCK_SYSCTL_AARCH64) ++extern bool GetDarwinSysCtlByName(const char*); ++extern int GetDarwinSysCtlByNameValue(const char* name); ++#else ++static int GetDarwinSysCtlByNameValue(const char* name) { ++ int enabled; ++ size_t enabled_len = sizeof(enabled); ++ const int failure = sysctlbyname(name, &enabled, &enabled_len, NULL, 0); ++ return failure ? 0 : enabled; ++} ++ ++static bool GetDarwinSysCtlByName(const char* name) { ++ return GetDarwinSysCtlByNameValue(name) != 0; ++} ++#endif ++ ++static const Aarch64Info kEmptyAarch64Info; ++ ++Aarch64Info GetAarch64Info(void) { ++ Aarch64Info info = kEmptyAarch64Info; ++ ++ // Handling Darwin platform through sysctlbyname. ++ info.implementer = GetDarwinSysCtlByNameValue("hw.cputype"); ++ info.variant = GetDarwinSysCtlByNameValue("hw.cpusubtype"); ++ info.part = GetDarwinSysCtlByNameValue("hw.cpufamily"); ++ info.revision = GetDarwinSysCtlByNameValue("hw.cpusubfamily"); ++ ++ info.features.fp = GetDarwinSysCtlByName("hw.optional.floatingpoint"); ++ info.features.asimd = GetDarwinSysCtlByName("hw.optional.AdvSIMD"); ++ info.features.aes = GetDarwinSysCtlByName("hw.optional.arm.FEAT_AES"); ++ info.features.pmull = GetDarwinSysCtlByName("hw.optional.arm.FEAT_PMULL"); ++ info.features.sha1 = GetDarwinSysCtlByName("hw.optional.arm.FEAT_SHA1"); ++ info.features.sha2 = GetDarwinSysCtlByName("hw.optional.arm.FEAT_SHA2"); ++ info.features.crc32 = GetDarwinSysCtlByName("hw.optional.armv8_crc32"); ++ info.features.atomics = GetDarwinSysCtlByName("hw.optional.armv8_1_atomics"); ++ info.features.fphp = GetDarwinSysCtlByName("hw.optional.neon_hpfp"); ++ info.features.jscvt = GetDarwinSysCtlByName("hw.optional.arm.FEAT_JSCVT"); ++ info.features.fcma = GetDarwinSysCtlByName("hw.optional.arm.FEAT_FCMA"); ++ info.features.lrcpc = GetDarwinSysCtlByName("hw.optional.arm.FEAT_LRCPC"); ++ info.features.sha3 = GetDarwinSysCtlByName("hw.optional.armv8_2_sha3"); ++ info.features.sha512 = GetDarwinSysCtlByName("hw.optional.armv8_2_sha512"); ++ info.features.asimdfhm = GetDarwinSysCtlByName("hw.optional.armv8_2_fhm"); ++ info.features.flagm = GetDarwinSysCtlByName("hw.optional.arm.FEAT_FLAGM"); ++ info.features.flagm2 = GetDarwinSysCtlByName("hw.optional.arm.FEAT_FLAGM2"); ++ info.features.ssbs = GetDarwinSysCtlByName("hw.optional.arm.FEAT_SSBS"); ++ info.features.sb = GetDarwinSysCtlByName("hw.optional.arm.FEAT_SB"); ++ info.features.i8mm = GetDarwinSysCtlByName("hw.optional.arm.FEAT_I8MM"); ++ info.features.bf16 = GetDarwinSysCtlByName("hw.optional.arm.FEAT_BF16"); ++ info.features.bti = GetDarwinSysCtlByName("hw.optional.arm.FEAT_BTI"); ++ ++ return info; ++} ++ ++#endif // defined(CPU_FEATURES_OS_MACOS) || defined(CPU_FEATURES_OS_IPHONE) ++#endif // CPU_FEATURES_ARCH_AARCH64 diff --git a/recipes/cpu_features/config.yml b/recipes/cpu_features/config.yml index 5af5c000c90f1..a4fbe67cb54a0 100644 --- a/recipes/cpu_features/config.yml +++ b/recipes/cpu_features/config.yml @@ -1,4 +1,6 @@ versions: + "0.8.0": + folder: "all" "0.7.0": folder: "all" "0.6.0": From d8e543255ac3196c12a175cfe33e7408f52f4c0d Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Sat, 29 Apr 2023 11:41:35 +0200 Subject: [PATCH 30/34] (#17288) restbed: use version range openssl + modernize more for conan v2 * use version range for openssl & bump asio * modernize more - add package_type - remove ipc option in config_options() instead of configure() - sort methods by order of execution --- recipes/restbed/all/conanfile.py | 31 ++++++++----------- .../all/test_v1_package/CMakeLists.txt | 13 +++----- 2 files changed, 18 insertions(+), 26 deletions(-) diff --git a/recipes/restbed/all/conanfile.py b/recipes/restbed/all/conanfile.py index 0a5e2d6cfc925..f63b47dfcb4cd 100644 --- a/recipes/restbed/all/conanfile.py +++ b/recipes/restbed/all/conanfile.py @@ -8,7 +8,7 @@ import os import re -required_conan_version = ">=1.52.0" +required_conan_version = ">=1.53.0" class RestbedConan(ConanFile): @@ -18,7 +18,7 @@ class RestbedConan(ConanFile): topics = ("restful", "server", "client", "json", "http", "ssl", "tls") url = "https://github.com/conan-io/conan-center-index" license = "AGPL-3.0-or-later", "LicenseRef-CPL" # Corvusoft Permissive License (CPL) - + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -51,15 +51,19 @@ def export_sources(self): def config_options(self): if self.settings.os == "Windows": del self.options.fPIC + del self.options.ipc def configure(self): if self.options.shared: - try: - del self.options.fPIC - except Exception: - pass - if self.settings.os in ("Windows", ): - del self.options.ipc + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("asio/1.27.0") + if self.options.with_openssl: + self.requires("openssl/[>=1.1 <4]") def validate(self): if getattr(self.info.settings.compiler, "cppstd"): @@ -71,17 +75,8 @@ def validate(self): f"{self.ref} requires C++{self._minimum_cpp_standard}, which your compiler does not support." ) - def layout(self): - cmake_layout(self, src_folder="src") - - def requirements(self): - self.requires("asio/1.24.0") - if self.options.with_openssl: - self.requires("openssl/3.0.5") - def source(self): - get(self, **self.conan_data["sources"][self.version], - destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): tc = CMakeToolchain(self) diff --git a/recipes/restbed/all/test_v1_package/CMakeLists.txt b/recipes/restbed/all/test_v1_package/CMakeLists.txt index 87b1318ff1676..0d20897301b68 100644 --- a/recipes/restbed/all/test_v1_package/CMakeLists.txt +++ b/recipes/restbed/all/test_v1_package/CMakeLists.txt @@ -1,11 +1,8 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) +cmake_minimum_required(VERSION 3.1) +project(test_package) -include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(restbed REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE restbed::restbed) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) From eccffc6d90e68e5de79ba5673c465b74a42dea6a Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Sat, 29 Apr 2023 12:02:05 +0200 Subject: [PATCH 31/34] (#17284) grpc: several improvements for conan v2 * several improvements - bump c-ares & re2 - remove full_package_mode for protobuf - avoid to have protobuf in build requirements in case of native build - avoid to have grpc in build requirements of test package in case of native build, mainly to avoid missing packages in c3i - use tool_requires instead of build_requires * expose abseil libs --- recipes/grpc/all/conanfile.py | 54 +++++++++++----------- recipes/grpc/all/test_package/conanfile.py | 30 ++++++------ 2 files changed, 40 insertions(+), 44 deletions(-) diff --git a/recipes/grpc/all/conanfile.py b/recipes/grpc/all/conanfile.py index 584cea79d847b..cf5aaa317ecb2 100644 --- a/recipes/grpc/all/conanfile.py +++ b/recipes/grpc/all/conanfile.py @@ -4,9 +4,9 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration from conan.tools.apple import is_apple_os -from conan.tools.build import cross_building, valid_min_cppstd, check_min_cppstd +from conan.tools.build import can_run, cross_building, valid_min_cppstd, check_min_cppstd from conan.tools.cmake import cmake_layout, CMake, CMakeToolchain, CMakeDeps -from conan.tools.env import VirtualBuildEnv +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rename, replace_in_file, rmdir from conan.tools.microsoft import check_min_vs, is_msvc from conan.tools.scm import Version @@ -14,7 +14,7 @@ required_conan_version = ">=1.53.0" -class grpcConan(ConanFile): +class GrpcConan(ConanFile): name = "grpc" package_type = "library" description = "Google's RPC (remote procedure call) library and framework." @@ -56,9 +56,6 @@ class grpcConan(ConanFile): short_paths = True - def layout(self): - cmake_layout(self, src_folder="src") - @property def _grpc_plugin_template(self): return "grpc_plugin_template.cmake.in" @@ -86,35 +83,38 @@ def configure(self): if cross_building(self): self.options["grpc"].shared = True + def layout(self): + cmake_layout(self, src_folder="src") + def requirements(self): + # abseil is public. See https://github.com/conan-io/conan-center-index/pull/17284#issuecomment-1526082638 if is_msvc(self) and Version(self.version) < "1.47": - self.requires("abseil/20211102.0", transitive_headers=True) + self.requires("abseil/20211102.0", transitive_headers=True, transitive_libs=True) else: - self.requires("abseil/20220623.0", transitive_headers=True) - self.requires("c-ares/1.18.1") + self.requires("abseil/20220623.0", transitive_headers=True, transitive_libs=True) + self.requires("c-ares/1.19.0") self.requires("openssl/[>=1.1 <4]") - self.requires("re2/20220601") + self.requires("re2/20230301") self.requires("zlib/1.2.13") - self.requires("protobuf/3.21.9", transitive_headers=True, transitive_libs=True) + self.requires("protobuf/3.21.9", transitive_headers=True, transitive_libs=True, run=can_run(self)) self.requires("googleapis/cci.20221108") self.requires("grpc-proto/cci.20220627") def package_id(self): del self.info.options.secure - self.info.requires["protobuf"].full_package_mode() def validate(self): check_min_vs(self, "190") - if is_msvc(self) and self.info.options.shared: + if is_msvc(self) and self.options.shared: raise ConanInvalidConfiguration(f"{self.ref} shared not supported by Visual Studio") - if Version(self.version) >= "1.47" and self.info.settings.compiler == "gcc" and Version(self.info.settings.compiler.version) < "6": + if Version(self.version) >= "1.47" and self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "6": raise ConanInvalidConfiguration("GCC older than 6 is not supported") - if self.info.settings.compiler.get_safe("cppstd"): + if self.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, self._cxxstd_required) - if self.info.options.shared and \ + if self.options.shared and \ (not self.dependencies["protobuf"].options.shared or not self.dependencies["googleapis"].options.shared or not self.dependencies["grpc-proto"].options.shared): raise ConanInvalidConfiguration( "If built as shared, protobuf, googleapis and grpc-proto must be shared as well. " @@ -122,18 +122,20 @@ def validate(self): ) def build_requirements(self): - if hasattr(self, "settings_build"): - self.build_requires('protobuf/3.21.9') + if not can_run(self): + self.tool_requires("protobuf/3.21.9") + if cross_building(self): # when cross compiling we need pre compiled grpc plugins for protoc - if cross_building(self): - self.build_requires('grpc/{}'.format(self.version)) + self.tool_requires(f"grpc/{self.version}") def source(self): - get(self, **self.conan_data["sources"][self.version], - destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): - + # Set up environment so that we can run grpc-cpp-plugin at build time + VirtualBuildEnv(self).generate() + if can_run(self): + VirtualRunEnv(self).generate(scope="build") # This doesn't work yet as one would expect, because the install target builds everything # and we need the install target because of the generated CMake files @@ -185,10 +187,6 @@ def generate(self): cmake_deps = CMakeDeps(self) cmake_deps.generate() - # Set up environment so that we can run grpc-cpp-plugin at build time - if hasattr(self, "settings_build"): - VirtualBuildEnv(self).generate() - def _patch_sources(self): apply_conandata_patches(self) @@ -210,7 +208,7 @@ def _patch_sources(self): # This workaround wraps the protoc command to be invoked by CMake with a modified environment settings_build = getattr(self, "settings_build", self.settings) if settings_build.os == "Macos": - replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), "COMMAND ${_gRPC_PROTOBUF_PROTOC_EXECUTABLE}", 'COMMAND ${CMAKE_COMMAND} -E env "DYLD_LIBRARY_PATH=$ENV{DYLD_LIBRARY_PATH}" ${_gRPC_PROTOBUF_PROTOC_EXECUTABLE}') def build(self): diff --git a/recipes/grpc/all/test_package/conanfile.py b/recipes/grpc/all/test_package/conanfile.py index d0170152b60d2..0f6a5af6c45a4 100644 --- a/recipes/grpc/all/test_package/conanfile.py +++ b/recipes/grpc/all/test_package/conanfile.py @@ -14,13 +14,23 @@ def layout(self): cmake_layout(self) def requirements(self): - self.requires(self.tested_reference_str) + self.requires(self.tested_reference_str, run=can_run(self)) def build_requirements(self): - # For the grpc-cpp-plugin executable - self.tool_requires(self.tested_reference_str) + if not can_run(self): + # For the grpc-cpp-plugin executable at build time + self.tool_requires(self.tested_reference_str) def generate(self): + # Set up environment so that we can run grpc-cpp-plugin at build time + VirtualBuildEnv(self).generate() + if can_run(self): + VirtualRunEnv(self).generate(scope="build") + + # Environment so that the compiled test executable can load shared libraries + runenv = VirtualRunEnv(self) + runenv.generate() + tc = CMakeToolchain(self) tc.cache_variables["TEST_ACTUAL_SERVER"] = not (is_msvc(self) and str(self.settings.compiler.version) in ("15", "191") @@ -31,22 +41,10 @@ def generate(self): project_include = os.path.join(self.source_folder, "macos_make_override.cmake") tc.cache_variables["CMAKE_PROJECT_test_package_INCLUDE"] = project_include tc.generate() - - # Set up environment so that we can run grpc-cpp-plugin at build time - if hasattr(self, "settings_build"): - VirtualBuildEnv(self).generate() - else: - # Cover case in Conan 1.x when only one profile is provided - self.output.info("Generating VirtualRunEnv in build environment - using two profiles is advised.") - VirtualRunEnv(self).generate(scope="build") - - # Environment so that the compiled test executable can load shared libraries - runenv = VirtualRunEnv(self) - runenv.generate(scope="run") deps = CMakeDeps(self) deps.generate() - + def build(self): cmake = CMake(self) cmake.configure() From 211d070af8c2d9bf943fb31cc7fe91777bd8e722 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Sat, 29 Apr 2023 12:24:44 +0200 Subject: [PATCH 32/34] (#17263) flatbuffers: use version range for cmake --- recipes/flatbuffers/all/conanfile.py | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/recipes/flatbuffers/all/conanfile.py b/recipes/flatbuffers/all/conanfile.py index 52f0f38733e5c..ff0db700336fb 100644 --- a/recipes/flatbuffers/all/conanfile.py +++ b/recipes/flatbuffers/all/conanfile.py @@ -42,27 +42,15 @@ def config_options(self): if self.settings.os == "Windows": del self.options.fPIC - 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 Version(self.version) >= "2.0.7" and not self._cmake_new_enough("3.16"): - self.tool_requires("cmake/3.25.3") - def configure(self): if self.options.shared or self.options.header_only: self.options.rm_safe("fPIC") if self.options.header_only: del self.options.shared + def layout(self): + cmake_layout(self, src_folder="src") + def package_id(self): if self.info.options.header_only and not self._has_flatc(info=True): self.info.clear() @@ -71,8 +59,9 @@ def validate(self): if self.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, 11) - def layout(self): - cmake_layout(self, src_folder="src") + def build_requirements(self): + if Version(self.version) >= "2.0.7": + self.tool_requires("cmake/[>=3.16 <4]") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) From 79a2fe3416c49d6dfc2961546c7e8e302464858b Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Sat, 29 Apr 2023 13:22:32 +0200 Subject: [PATCH 33/34] (#17262) googleapis: use version range for cmake --- recipes/googleapis/all/conanfile.py | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/recipes/googleapis/all/conanfile.py b/recipes/googleapis/all/conanfile.py index bb0a56e9d71cd..823693a078c6a 100644 --- a/recipes/googleapis/all/conanfile.py +++ b/recipes/googleapis/all/conanfile.py @@ -72,24 +72,12 @@ def validate(self): if self.options.shared and not self.dependencies["protobuf"].options.shared: raise ConanInvalidConfiguration("If built as shared, protobuf must be shared as well. Please, use `protobuf:shared=True`") - 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 not can_run(self): self.tool_requires(f"protobuf/{self._protobuf_version}") # CMake >= 3.20 is required. There is a proto with dots in the name 'k8s.min.proto' and CMake fails to generate project files - if not self._cmake_new_enough("3.20"): - self.tool_requires("cmake/3.25.3") + self.tool_requires("cmake/[>=3.20 <4]") def source(self): get(self, **self.conan_data["sources"][str(self.version)], strip_root=True) From 2646a69f1966cbfc2cd303b625a8fef0faf55ea8 Mon Sep 17 00:00:00 2001 From: Joris Putcuyps Date: Sat, 29 Apr 2023 14:04:00 +0200 Subject: [PATCH 34/34] (#17250) Improve ArduinoJson and add 6.21.2 * Add package_type and safer cppstd check for v1 * Add version 6.21.2 * Workaround for v1 C++11 check * Disable apple-clang for now * Allow apple-clang but require the cppstd * Fix github warnings * fixup: format prefix was missing --------- Co-authored-by: Chris Mc --- recipes/arduinojson/all/conandata.yml | 3 +++ recipes/arduinojson/all/conanfile.py | 20 +++++++++++++++++++- recipes/arduinojson/config.yml | 2 ++ 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/recipes/arduinojson/all/conandata.yml b/recipes/arduinojson/all/conandata.yml index 8cd5e36ab9fb1..d44d34b58314d 100644 --- a/recipes/arduinojson/all/conandata.yml +++ b/recipes/arduinojson/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "6.21.2": + url: "https://github.com/bblanchon/ArduinoJson/releases/download/v6.21.2/ArduinoJson-v6.21.2.zip" + sha256: "1dc888061f6e7828f7a0a4e71bf059796e5ce202ce6ddb4e3a2e384d32b5cba0" "6.21.0": url: "https://github.com/bblanchon/ArduinoJson/releases/download/v6.21.0/ArduinoJson-v6.21.0.zip" sha256: "08f7cad5fca2393c40fcb479c43235a2fa7da1a40331377ddf617eda2f123583" diff --git a/recipes/arduinojson/all/conanfile.py b/recipes/arduinojson/all/conanfile.py index 18a97a6e9847a..af682213f09dd 100644 --- a/recipes/arduinojson/all/conanfile.py +++ b/recipes/arduinojson/all/conanfile.py @@ -3,6 +3,7 @@ from conan.tools.layout import basic_layout from conan.tools.scm import Version from conan.tools.build import check_min_cppstd +from conan.errors import ConanInvalidConfiguration import os import textwrap @@ -16,12 +17,29 @@ class ArduinojsonConan(ConanFile): topics = ("json", "arduino", "iot", "embedded", "esp8266") license = "MIT" url = "https://github.com/conan-io/conan-center-index" + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True + @property + def _compilers_minimum_version(self): + return { + "Visual Studio": "16", + "msvc": "192", + "gcc": "6", + "clang": "6", + } + def validate(self): if Version(self.version) >= "6.21.0": - check_min_cppstd(self, 11) + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) + elif str(self.settings.compiler) == 'apple-clang': + raise ConanInvalidConfiguration("cppstd needs to be set on apple-clang to activate c++11.") + else: + 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++11, which your compiler does not support.") def package_id(self): self.info.clear() diff --git a/recipes/arduinojson/config.yml b/recipes/arduinojson/config.yml index 803d10dbd17d2..3358de6326521 100644 --- a/recipes/arduinojson/config.yml +++ b/recipes/arduinojson/config.yml @@ -1,4 +1,6 @@ versions: + "6.21.2": + folder: all "6.21.0": folder: all "6.20.1":