From ad96cd75f746664d425d80478da2d84f04c265ca Mon Sep 17 00:00:00 2001 From: Carlos Gomes Martinho Date: Thu, 20 Feb 2020 14:09:16 +0100 Subject: [PATCH 01/30] feat: add initial libcoap --- recipes/libcoap/all/CMakeLists.txt | 7 ++ recipes/libcoap/all/conandata.yml | 4 + recipes/libcoap/all/conanfile.py | 76 +++++++++++++++++++ .../libcoap/all/test_package/CMakeLists.txt | 11 +++ recipes/libcoap/all/test_package/conanfile.py | 18 +++++ .../libcoap/all/test_package/test_package.cpp | 5 ++ recipes/libcoap/config.yml | 4 + 7 files changed, 125 insertions(+) create mode 100644 recipes/libcoap/all/CMakeLists.txt create mode 100644 recipes/libcoap/all/conandata.yml create mode 100644 recipes/libcoap/all/conanfile.py create mode 100644 recipes/libcoap/all/test_package/CMakeLists.txt create mode 100644 recipes/libcoap/all/test_package/conanfile.py create mode 100644 recipes/libcoap/all/test_package/test_package.cpp create mode 100644 recipes/libcoap/config.yml diff --git a/recipes/libcoap/all/CMakeLists.txt b/recipes/libcoap/all/CMakeLists.txt new file mode 100644 index 0000000000000..361b35d4c17d9 --- /dev/null +++ b/recipes/libcoap/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 2.8.11) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +add_subdirectory(source_subfolder) diff --git a/recipes/libcoap/all/conandata.yml b/recipes/libcoap/all/conandata.yml new file mode 100644 index 0000000000000..fd9c3d8638a47 --- /dev/null +++ b/recipes/libcoap/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "20200220": + sha256: ace3be84bfdf0e31e892bfaeaf442d5062d590a533fc39f64c2ef96549c614bc + url: https://github.com/gocarlos/libcoap/archive/21ea160d0f4aa832e2d545fce39ea9b60d0b8c12.zip diff --git a/recipes/libcoap/all/conanfile.py b/recipes/libcoap/all/conanfile.py new file mode 100644 index 0000000000000..2a1891644ca75 --- /dev/null +++ b/recipes/libcoap/all/conanfile.py @@ -0,0 +1,76 @@ +import os +from conans import CMake, ConanFile, tools + + +class LibCoapConan(ConanFile): + name = "libcoap" + license = "BSD-2-Clause" + homepage = "https://github.com/gocarlos/libcoap/" + url = "https://github.com/conan-io/conan-center-index" + description = """A CoAP (RFC 7252) implementation in C""" + topics = ("coap") + exports_sources = "CMakeLists.txt" + settings = "os", "compiler", "build_type", "arch" + options = { + "shared": [True, False], + "fPIC": [True, False], + "enable_dtls": [True, False] + } + default_options = { + "shared": False, + "fPIC": True, + "enable_dtls": True + } + generators = "cmake", "cmake_find_package" + + _cmake = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _build_subfolder(self): + return "build_subfolder" + + def requirements(self): + if self.options.enable_dtls: + self.requires.add("openssl/1.1.1d") + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + extracted_dir = self.name + "-" + os.path.basename(self.conan_data["sources"][self.version]["url"]).split(".")[0] + os.rename(extracted_dir, self._source_subfolder) + + def _configure_cmake(self): + if self._cmake: + return self._cmake + self._cmake = CMake(self) + self._cmake.definitions["ENABLE_DTLS"] = self.options.enable_dtls + self._cmake.configure(build_folder=self._build_subfolder) + return self._cmake + + def build(self): + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy("LICENSE", dst='licenses', src=os.path.join(self._source_subfolder, "license")) + cmake = self._configure_cmake() + cmake.install() + tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) + tools.rmdir(os.path.join(self.package_folder, + "lib", "libcoap", "cmake")) + + def package_info(self): + self.cpp_info.libs = ["libcoap"] + if self.settings.os == "Linux": + self.cpp_info.system_libs = ["pthread"] diff --git a/recipes/libcoap/all/test_package/CMakeLists.txt b/recipes/libcoap/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..92c5bbb1b2abb --- /dev/null +++ b/recipes/libcoap/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +project(test_package) +cmake_minimum_required(VERSION 2.8.11) + +set(CMAKE_VERBOSE_MAKEFILE TRUE) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/libcoap/all/test_package/conanfile.py b/recipes/libcoap/all/test_package/conanfile.py new file mode 100644 index 0000000000000..933dbf96533ae --- /dev/null +++ b/recipes/libcoap/all/test_package/conanfile.py @@ -0,0 +1,18 @@ +import os + +from conans import ConanFile, CMake, tools + + +class TestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + bin_path = self.run(bin_path, run_environment=True) diff --git a/recipes/libcoap/all/test_package/test_package.cpp b/recipes/libcoap/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..a2022a535bc59 --- /dev/null +++ b/recipes/libcoap/all/test_package/test_package.cpp @@ -0,0 +1,5 @@ + +int main(int argc, char *argv[]) { + + return 0; +} diff --git a/recipes/libcoap/config.yml b/recipes/libcoap/config.yml new file mode 100644 index 0000000000000..61ceb6fb22ae0 --- /dev/null +++ b/recipes/libcoap/config.yml @@ -0,0 +1,4 @@ +--- +versions: + "20200220": + folder: "all" From 7bd0fa5553f8f5c1ef5e3705bd5845eaaccb027e Mon Sep 17 00:00:00 2001 From: Carlos Gomes Martinho Date: Thu, 20 Feb 2020 14:17:52 +0100 Subject: [PATCH 02/30] chore: add some code to libcoap test package --- recipes/libcoap/all/test_package/test_package.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/recipes/libcoap/all/test_package/test_package.cpp b/recipes/libcoap/all/test_package/test_package.cpp index a2022a535bc59..7487eb03d81cd 100644 --- a/recipes/libcoap/all/test_package/test_package.cpp +++ b/recipes/libcoap/all/test_package/test_package.cpp @@ -1,5 +1,13 @@ +#include "coap2/coap.h" int main(int argc, char *argv[]) { + coap_startup(); + + // create CoAP context and a client session + coap_context_t *ctx = coap_new_context(nullptr); + + coap_free_context(ctx); + coap_cleanup(); return 0; } From 69ab89ab9c2ba86d4d2a9ddc33586e86c575d04c Mon Sep 17 00:00:00 2001 From: Carlos Gomes Martinho Date: Thu, 20 Feb 2020 14:25:56 +0100 Subject: [PATCH 03/30] chore: add support for tls lib --- recipes/libcoap/all/conanfile.py | 36 ++++++++++++++++++++++++++------ 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/recipes/libcoap/all/conanfile.py b/recipes/libcoap/all/conanfile.py index 2a1891644ca75..cf786091739e3 100644 --- a/recipes/libcoap/all/conanfile.py +++ b/recipes/libcoap/all/conanfile.py @@ -1,5 +1,6 @@ import os from conans import CMake, ConanFile, tools +from conans.errors import ConanInvalidConfiguration class LibCoapConan(ConanFile): @@ -14,12 +15,22 @@ class LibCoapConan(ConanFile): options = { "shared": [True, False], "fPIC": [True, False], - "enable_dtls": [True, False] + "enable_dtls": [True, False], + "with_openssl": [True, False], + "with_gnutls": [True, False], + "with_tinydtls": [True, False], + "with_mbedtls": [True, False], + "with_epoll": [True, False], } default_options = { "shared": False, "fPIC": True, - "enable_dtls": True + "enable_dtls": True, + "with_openssl": True, + "with_gnutls": False, + "with_tinydtls": False, + "with_mbedtls": False, + "with_epoll": False, } generators = "cmake", "cmake_find_package" @@ -34,8 +45,14 @@ def _build_subfolder(self): return "build_subfolder" def requirements(self): - if self.options.enable_dtls: + if self.options.enable_dtls and self.options.with_openssl: self.requires.add("openssl/1.1.1d") + if self.options.enable_dtls and self.options.with_mbedtls: + self.requires.add("mbedtls/2.16.3-apache") + if self.options.enable_dtls and self.options.with_gnutls: + raise ConanInvalidConfiguration("gnu tls not available yet") + if self.options.enable_dtls and self.options.with_tinydtls: + raise ConanInvalidConfiguration("tinydtls not available yet") def config_options(self): if self.settings.os == "Windows": @@ -47,7 +64,9 @@ def configure(self): def source(self): tools.get(**self.conan_data["sources"][self.version]) - extracted_dir = self.name + "-" + os.path.basename(self.conan_data["sources"][self.version]["url"]).split(".")[0] + extracted_dir = self.name + "-" + \ + os.path.basename( + self.conan_data["sources"][self.version]["url"]).split(".")[0] os.rename(extracted_dir, self._source_subfolder) def _configure_cmake(self): @@ -55,6 +74,10 @@ def _configure_cmake(self): return self._cmake self._cmake = CMake(self) self._cmake.definitions["ENABLE_DTLS"] = self.options.enable_dtls + self._cmake.definitions["WITH_OPENSSL"] = self.options.with_openssl + self._cmake.definitions["WITH_GNUTLS"] = self.options.with_gnutls + self._cmake.definitions["WITH_TINYDTLS"] = self.options.with_tinydtls + self._cmake.definitions["WITH_EPOLL"] = self.options.with_epoll self._cmake.configure(build_folder=self._build_subfolder) return self._cmake @@ -63,7 +86,8 @@ def build(self): cmake.build() def package(self): - self.copy("LICENSE", dst='licenses', src=os.path.join(self._source_subfolder, "license")) + self.copy("LICENSE", dst='licenses', src=os.path.join( + self._source_subfolder, "license")) cmake = self._configure_cmake() cmake.install() tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) @@ -71,6 +95,6 @@ def package(self): "lib", "libcoap", "cmake")) def package_info(self): - self.cpp_info.libs = ["libcoap"] + self.cpp_info.libs = ["coap"] if self.settings.os == "Linux": self.cpp_info.system_libs = ["pthread"] From 2ddc51c5d10e6494b0e502cfc06494d19a23210b Mon Sep 17 00:00:00 2001 From: Carlos Gomes Martinho Date: Thu, 27 Feb 2020 09:18:25 +0100 Subject: [PATCH 04/30] chore: simplify recipe --- recipes/libcoap/all/conanfile.py | 29 +++++++++++------------------ 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/recipes/libcoap/all/conanfile.py b/recipes/libcoap/all/conanfile.py index cf786091739e3..4f7734011bffd 100644 --- a/recipes/libcoap/all/conanfile.py +++ b/recipes/libcoap/all/conanfile.py @@ -15,22 +15,14 @@ class LibCoapConan(ConanFile): options = { "shared": [True, False], "fPIC": [True, False], - "enable_dtls": [True, False], - "with_openssl": [True, False], - "with_gnutls": [True, False], - "with_tinydtls": [True, False], - "with_mbedtls": [True, False], "with_epoll": [True, False], + "tls_backend": [None, "with_openssl", "with_gnutls", "with_tinydtls", "with_mbedtls"], } default_options = { "shared": False, "fPIC": True, - "enable_dtls": True, - "with_openssl": True, - "with_gnutls": False, - "with_tinydtls": False, - "with_mbedtls": False, "with_epoll": False, + "tls_backend": "with_openssl", } generators = "cmake", "cmake_find_package" @@ -45,13 +37,13 @@ def _build_subfolder(self): return "build_subfolder" def requirements(self): - if self.options.enable_dtls and self.options.with_openssl: + if self.options.tls_backend == "with_openssl": self.requires.add("openssl/1.1.1d") - if self.options.enable_dtls and self.options.with_mbedtls: + if self.options.tls_backend == "with_mbedtls": self.requires.add("mbedtls/2.16.3-apache") - if self.options.enable_dtls and self.options.with_gnutls: + if self.options.tls_backend == "with_gnutls": raise ConanInvalidConfiguration("gnu tls not available yet") - if self.options.enable_dtls and self.options.with_tinydtls: + if self.options.tls_backend == "with_tinydtls": raise ConanInvalidConfiguration("tinydtls not available yet") def config_options(self): @@ -73,11 +65,12 @@ def _configure_cmake(self): if self._cmake: return self._cmake self._cmake = CMake(self) - self._cmake.definitions["ENABLE_DTLS"] = self.options.enable_dtls - self._cmake.definitions["WITH_OPENSSL"] = self.options.with_openssl - self._cmake.definitions["WITH_GNUTLS"] = self.options.with_gnutls - self._cmake.definitions["WITH_TINYDTLS"] = self.options.with_tinydtls self._cmake.definitions["WITH_EPOLL"] = self.options.with_epoll + self._cmake.definitions["ENABLE_DTLS"] = self.options.tls_backend != None + self._cmake.definitions["WITH_OPENSSL"] = self.options.tls_backend == "with_openssl" + self._cmake.definitions["WITH_MBEDTLS"] = self.options.tls_backend == "with_mbedtls" + self._cmake.definitions["WITH_GNUTLS"] = self.options.tls_backend == "with_gnutls" + self._cmake.definitions["WITH_TINYDTLS"] = self.options.tls_backend == "with_tinydtls" self._cmake.configure(build_folder=self._build_subfolder) return self._cmake From e9b988f1070634506fdfa3d3f35d171f3b2d6f5b Mon Sep 17 00:00:00 2001 From: Carlos Gomes Martinho Date: Mon, 23 Mar 2020 16:56:48 +0100 Subject: [PATCH 05/30] chore: patch openssl stuff --- recipes/libcoap/all/conanfile.py | 8 ++++++++ recipes/libcoap/all/test_package/test_package.cpp | 6 ++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/recipes/libcoap/all/conanfile.py b/recipes/libcoap/all/conanfile.py index 4f7734011bffd..46060bbb68484 100644 --- a/recipes/libcoap/all/conanfile.py +++ b/recipes/libcoap/all/conanfile.py @@ -46,6 +46,13 @@ def requirements(self): if self.options.tls_backend == "with_tinydtls": raise ConanInvalidConfiguration("tinydtls not available yet") + def _patch_files(self): + if self.options.tls_backend == "with_openssl": + replace_ssl = 'OpenSSL::SSL' + tools.replace_in_file(os.path.join(self._source_subfolder, "CMakeLists.txt"), replace_ssl, "OpenSSL::OpenSSL") + replace_crypto = 'OpenSSL::Crypto' + tools.replace_in_file(os.path.join(self._source_subfolder, "CMakeLists.txt"), replace_crypto, "OpenSSL::OpenSSL") + def config_options(self): if self.settings.os == "Windows": del self.options.fPIC @@ -75,6 +82,7 @@ def _configure_cmake(self): return self._cmake def build(self): + self._patch_files() cmake = self._configure_cmake() cmake.build() diff --git a/recipes/libcoap/all/test_package/test_package.cpp b/recipes/libcoap/all/test_package/test_package.cpp index 7487eb03d81cd..8e75bb8972a71 100644 --- a/recipes/libcoap/all/test_package/test_package.cpp +++ b/recipes/libcoap/all/test_package/test_package.cpp @@ -1,6 +1,8 @@ #include "coap2/coap.h" +#include -int main(int argc, char *argv[]) { +int main() { + std::cout << "starting" << std::endl; coap_startup(); // create CoAP context and a client session @@ -8,6 +10,6 @@ int main(int argc, char *argv[]) { coap_free_context(ctx); coap_cleanup(); - + std::cout << "stopping" << std::endl; return 0; } From 0c517ebd38f787ccf6f92bf1e742c9f72757bc21 Mon Sep 17 00:00:00 2001 From: Carlos Gomes Martinho Date: Mon, 23 Mar 2020 17:07:20 +0100 Subject: [PATCH 06/30] fix: test package --- recipes/libcoap/all/test_package/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/libcoap/all/test_package/CMakeLists.txt b/recipes/libcoap/all/test_package/CMakeLists.txt index 92c5bbb1b2abb..4354080150986 100644 --- a/recipes/libcoap/all/test_package/CMakeLists.txt +++ b/recipes/libcoap/all/test_package/CMakeLists.txt @@ -1,5 +1,5 @@ -project(test_package) cmake_minimum_required(VERSION 2.8.11) +project(test_package) set(CMAKE_VERBOSE_MAKEFILE TRUE) From ad5f4bb2a5343578c93f5200a9095cb2d76cd070 Mon Sep 17 00:00:00 2001 From: Carlos Gomes Martinho Date: Mon, 23 Mar 2020 17:24:48 +0100 Subject: [PATCH 07/30] fix: path to license --- recipes/libcoap/all/conanfile.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/recipes/libcoap/all/conanfile.py b/recipes/libcoap/all/conanfile.py index 46060bbb68484..65c4dff57457d 100644 --- a/recipes/libcoap/all/conanfile.py +++ b/recipes/libcoap/all/conanfile.py @@ -87,8 +87,7 @@ def build(self): cmake.build() def package(self): - self.copy("LICENSE", dst='licenses', src=os.path.join( - self._source_subfolder, "license")) + self.copy("LICENSE", src=self._source_subfolder, dst="licenses") cmake = self._configure_cmake() cmake.install() tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) From 47f678f2f282704d4a40eb15322fbde9631612bb Mon Sep 17 00:00:00 2001 From: Carlos Gomes Martinho Date: Fri, 24 Apr 2020 20:58:30 +0200 Subject: [PATCH 08/30] chore: bump version --- recipes/libcoap/all/conandata.yml | 6 +++--- recipes/libcoap/all/test_package/conanfile.py | 1 - recipes/libcoap/config.yml | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/recipes/libcoap/all/conandata.yml b/recipes/libcoap/all/conandata.yml index fd9c3d8638a47..9cb25e7c70429 100644 --- a/recipes/libcoap/all/conandata.yml +++ b/recipes/libcoap/all/conandata.yml @@ -1,4 +1,4 @@ sources: - "20200220": - sha256: ace3be84bfdf0e31e892bfaeaf442d5062d590a533fc39f64c2ef96549c614bc - url: https://github.com/gocarlos/libcoap/archive/21ea160d0f4aa832e2d545fce39ea9b60d0b8c12.zip + "20200424": + sha256: 8402bf2dd9979d6d5f823a050cd3533619fe9b21e76be8c69a9b7d8b8ea175ab + url: https://github.com/obgm/libcoap/archive/17957e1e687c2218b7752a8a959eac36dbf5cb62.zip diff --git a/recipes/libcoap/all/test_package/conanfile.py b/recipes/libcoap/all/test_package/conanfile.py index 933dbf96533ae..6c0a50e0f7678 100644 --- a/recipes/libcoap/all/test_package/conanfile.py +++ b/recipes/libcoap/all/test_package/conanfile.py @@ -1,5 +1,4 @@ import os - from conans import ConanFile, CMake, tools diff --git a/recipes/libcoap/config.yml b/recipes/libcoap/config.yml index 61ceb6fb22ae0..b08bca79f4402 100644 --- a/recipes/libcoap/config.yml +++ b/recipes/libcoap/config.yml @@ -1,4 +1,4 @@ --- versions: - "20200220": + "20200424": folder: "all" From 0015c813fa9e96d309a947eb061a33b0baa4d02a Mon Sep 17 00:00:00 2001 From: Carlos Gomes Martinho Date: Fri, 24 Apr 2020 21:07:40 +0200 Subject: [PATCH 09/30] chore: use dtls_backend --- recipes/libcoap/all/conanfile.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/recipes/libcoap/all/conanfile.py b/recipes/libcoap/all/conanfile.py index 65c4dff57457d..a4cb7d5de3d1c 100644 --- a/recipes/libcoap/all/conanfile.py +++ b/recipes/libcoap/all/conanfile.py @@ -16,13 +16,13 @@ class LibCoapConan(ConanFile): "shared": [True, False], "fPIC": [True, False], "with_epoll": [True, False], - "tls_backend": [None, "with_openssl", "with_gnutls", "with_tinydtls", "with_mbedtls"], + "tls_backend": [None, "openssl", "gnutls", "tinydtls", "mbedtls"], } default_options = { "shared": False, "fPIC": True, "with_epoll": False, - "tls_backend": "with_openssl", + "tls_backend": "openssl", } generators = "cmake", "cmake_find_package" @@ -37,17 +37,17 @@ def _build_subfolder(self): return "build_subfolder" def requirements(self): - if self.options.tls_backend == "with_openssl": + if self.options.tls_backend == "openssl": self.requires.add("openssl/1.1.1d") - if self.options.tls_backend == "with_mbedtls": + if self.options.tls_backend == "mbedtls": self.requires.add("mbedtls/2.16.3-apache") - if self.options.tls_backend == "with_gnutls": + if self.options.tls_backend == "gnutls": raise ConanInvalidConfiguration("gnu tls not available yet") - if self.options.tls_backend == "with_tinydtls": + if self.options.tls_backend == "tinydtls": raise ConanInvalidConfiguration("tinydtls not available yet") def _patch_files(self): - if self.options.tls_backend == "with_openssl": + if self.options.tls_backend == "openssl": replace_ssl = 'OpenSSL::SSL' tools.replace_in_file(os.path.join(self._source_subfolder, "CMakeLists.txt"), replace_ssl, "OpenSSL::OpenSSL") replace_crypto = 'OpenSSL::Crypto' @@ -58,6 +58,9 @@ def config_options(self): del self.options.fPIC def configure(self): + if self.settings.os_build != "Windows": + raise ConanInvalidConfiguration("Only Windows supported") + del self.settings.compiler.libcxx del self.settings.compiler.cppstd @@ -74,10 +77,7 @@ def _configure_cmake(self): self._cmake = CMake(self) self._cmake.definitions["WITH_EPOLL"] = self.options.with_epoll self._cmake.definitions["ENABLE_DTLS"] = self.options.tls_backend != None - self._cmake.definitions["WITH_OPENSSL"] = self.options.tls_backend == "with_openssl" - self._cmake.definitions["WITH_MBEDTLS"] = self.options.tls_backend == "with_mbedtls" - self._cmake.definitions["WITH_GNUTLS"] = self.options.tls_backend == "with_gnutls" - self._cmake.definitions["WITH_TINYDTLS"] = self.options.tls_backend == "with_tinydtls" + self._cmake.definitions["DTLS_BACKEND"] = self.options.tls_backend self._cmake.configure(build_folder=self._build_subfolder) return self._cmake From a027ad312891257d266d0fad55ebe0ba68a2891b Mon Sep 17 00:00:00 2001 From: Carlos Gomes Martinho Date: Fri, 24 Apr 2020 21:08:25 +0200 Subject: [PATCH 10/30] chore: rename to dtls_backend --- recipes/libcoap/all/conanfile.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/recipes/libcoap/all/conanfile.py b/recipes/libcoap/all/conanfile.py index a4cb7d5de3d1c..f55641f409576 100644 --- a/recipes/libcoap/all/conanfile.py +++ b/recipes/libcoap/all/conanfile.py @@ -16,13 +16,13 @@ class LibCoapConan(ConanFile): "shared": [True, False], "fPIC": [True, False], "with_epoll": [True, False], - "tls_backend": [None, "openssl", "gnutls", "tinydtls", "mbedtls"], + "dtls_backend": [None, "openssl", "gnutls", "tinydtls", "mbedtls"], } default_options = { "shared": False, "fPIC": True, "with_epoll": False, - "tls_backend": "openssl", + "dtls_backend": "openssl", } generators = "cmake", "cmake_find_package" @@ -37,17 +37,17 @@ def _build_subfolder(self): return "build_subfolder" def requirements(self): - if self.options.tls_backend == "openssl": + if self.options.dtls_backend == "openssl": self.requires.add("openssl/1.1.1d") - if self.options.tls_backend == "mbedtls": + if self.options.dtls_backend == "mbedtls": self.requires.add("mbedtls/2.16.3-apache") - if self.options.tls_backend == "gnutls": + if self.options.dtls_backend == "gnutls": raise ConanInvalidConfiguration("gnu tls not available yet") - if self.options.tls_backend == "tinydtls": + if self.options.dtls_backend == "tinydtls": raise ConanInvalidConfiguration("tinydtls not available yet") def _patch_files(self): - if self.options.tls_backend == "openssl": + if self.options.dtls_backend == "openssl": replace_ssl = 'OpenSSL::SSL' tools.replace_in_file(os.path.join(self._source_subfolder, "CMakeLists.txt"), replace_ssl, "OpenSSL::OpenSSL") replace_crypto = 'OpenSSL::Crypto' @@ -76,8 +76,8 @@ def _configure_cmake(self): return self._cmake self._cmake = CMake(self) self._cmake.definitions["WITH_EPOLL"] = self.options.with_epoll - self._cmake.definitions["ENABLE_DTLS"] = self.options.tls_backend != None - self._cmake.definitions["DTLS_BACKEND"] = self.options.tls_backend + self._cmake.definitions["ENABLE_DTLS"] = self.options.dtls_backend != None + self._cmake.definitions["DTLS_BACKEND"] = self.options.dtls_backend self._cmake.configure(build_folder=self._build_subfolder) return self._cmake From d1931efb0e09fb1c4050a1054795a3610ec76b7c Mon Sep 17 00:00:00 2001 From: Carlos Gomes Martinho Date: Sun, 26 Apr 2020 17:06:55 +0200 Subject: [PATCH 11/30] fix: conan exceptions --- recipes/libcoap/all/conanfile.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/recipes/libcoap/all/conanfile.py b/recipes/libcoap/all/conanfile.py index f55641f409576..d7c5edd440b54 100644 --- a/recipes/libcoap/all/conanfile.py +++ b/recipes/libcoap/all/conanfile.py @@ -58,9 +58,6 @@ def config_options(self): del self.options.fPIC def configure(self): - if self.settings.os_build != "Windows": - raise ConanInvalidConfiguration("Only Windows supported") - del self.settings.compiler.libcxx del self.settings.compiler.cppstd From 822dab5f2c5409eca7939edd57dfad3237ded6b1 Mon Sep 17 00:00:00 2001 From: Carlos Gomes Martinho Date: Sun, 26 Apr 2020 18:35:28 +0200 Subject: [PATCH 12/30] remove support for windows and mac --- recipes/libcoap/all/conanfile.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/recipes/libcoap/all/conanfile.py b/recipes/libcoap/all/conanfile.py index d7c5edd440b54..78acbbacbc145 100644 --- a/recipes/libcoap/all/conanfile.py +++ b/recipes/libcoap/all/conanfile.py @@ -58,6 +58,9 @@ def config_options(self): del self.options.fPIC def configure(self): + if self.settings.os in ("Windows", "Macos"): + raise ConanInvalidConfiguration("Platform is currently not supported") + del self.settings.compiler.libcxx del self.settings.compiler.cppstd From ed57604dece16a58c38c7198513092e3e91cfc2b Mon Sep 17 00:00:00 2001 From: Carlos Gomes Martinho Date: Mon, 27 Apr 2020 23:15:30 +0200 Subject: [PATCH 13/30] Update recipes/libcoap/all/conanfile.py Co-Authored-By: Uilian Ries --- recipes/libcoap/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/libcoap/all/conanfile.py b/recipes/libcoap/all/conanfile.py index 78acbbacbc145..687d72135b201 100644 --- a/recipes/libcoap/all/conanfile.py +++ b/recipes/libcoap/all/conanfile.py @@ -38,7 +38,7 @@ def _build_subfolder(self): def requirements(self): if self.options.dtls_backend == "openssl": - self.requires.add("openssl/1.1.1d") + self.requires.add("openssl/1.1.1g") if self.options.dtls_backend == "mbedtls": self.requires.add("mbedtls/2.16.3-apache") if self.options.dtls_backend == "gnutls": From ca1f675285799f0fd51047101b36587dd5551254 Mon Sep 17 00:00:00 2001 From: Carlos Gomes Martinho Date: Tue, 28 Apr 2020 23:20:05 +0200 Subject: [PATCH 14/30] Update recipes/libcoap/all/conanfile.py Co-Authored-By: Uilian Ries --- recipes/libcoap/all/conanfile.py | 1 + 1 file changed, 1 insertion(+) diff --git a/recipes/libcoap/all/conanfile.py b/recipes/libcoap/all/conanfile.py index 687d72135b201..1d7ece33eb487 100644 --- a/recipes/libcoap/all/conanfile.py +++ b/recipes/libcoap/all/conanfile.py @@ -47,6 +47,7 @@ def requirements(self): raise ConanInvalidConfiguration("tinydtls not available yet") def _patch_files(self): + # TODO: Remove custom targets when Conan components be available. if self.options.dtls_backend == "openssl": replace_ssl = 'OpenSSL::SSL' tools.replace_in_file(os.path.join(self._source_subfolder, "CMakeLists.txt"), replace_ssl, "OpenSSL::OpenSSL") From efac372f68e4ee719d64647561e1dbe9ee4fd357 Mon Sep 17 00:00:00 2001 From: Carlos Gomes Martinho Date: Fri, 1 May 2020 09:43:38 +0200 Subject: [PATCH 15/30] Update recipes/libcoap/all/conanfile.py Co-authored-by: Uilian Ries --- recipes/libcoap/all/conanfile.py | 1 + 1 file changed, 1 insertion(+) diff --git a/recipes/libcoap/all/conanfile.py b/recipes/libcoap/all/conanfile.py index 1d7ece33eb487..2d033cd8bce5d 100644 --- a/recipes/libcoap/all/conanfile.py +++ b/recipes/libcoap/all/conanfile.py @@ -97,5 +97,6 @@ def package(self): def package_info(self): self.cpp_info.libs = ["coap"] + self.cpp_info.names['pkg_config'] = "libcoap-2{}".format("-" + self.options.dtls_backend if self.options.dtls_backend else "") if self.settings.os == "Linux": self.cpp_info.system_libs = ["pthread"] From 530560747f146112c0010805bb48e9bbac4a2b2b Mon Sep 17 00:00:00 2001 From: Carlos Gomes Martinho Date: Sat, 13 Jun 2020 11:48:40 +0200 Subject: [PATCH 16/30] fix: pkgconfig --- recipes/libcoap/all/conanfile.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/recipes/libcoap/all/conanfile.py b/recipes/libcoap/all/conanfile.py index 2d033cd8bce5d..56dbab4c9165a 100644 --- a/recipes/libcoap/all/conanfile.py +++ b/recipes/libcoap/all/conanfile.py @@ -97,6 +97,9 @@ def package(self): def package_info(self): self.cpp_info.libs = ["coap"] - self.cpp_info.names['pkg_config'] = "libcoap-2{}".format("-" + self.options.dtls_backend if self.options.dtls_backend else "") + if self.options.dtls_backend == None: + self.cpp_info.names['pkg_config'] = "libcoap-2" + else: + self.cpp_info.names['pkg_config'] = "libcoap-2-{}".format(self.options.dtls_backend) if self.settings.os == "Linux": self.cpp_info.system_libs = ["pthread"] From f76707cef7b991a315e82701157b2301bb6bd709 Mon Sep 17 00:00:00 2001 From: Carlos Gomes Martinho Date: Sat, 13 Jun 2020 12:05:01 +0200 Subject: [PATCH 17/30] style: fix new hooks --- recipes/libcoap/all/conanfile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/libcoap/all/conanfile.py b/recipes/libcoap/all/conanfile.py index 56dbab4c9165a..e52464c8e7882 100644 --- a/recipes/libcoap/all/conanfile.py +++ b/recipes/libcoap/all/conanfile.py @@ -38,9 +38,9 @@ def _build_subfolder(self): def requirements(self): if self.options.dtls_backend == "openssl": - self.requires.add("openssl/1.1.1g") + self.requires("openssl/1.1.1g") if self.options.dtls_backend == "mbedtls": - self.requires.add("mbedtls/2.16.3-apache") + self.requires("mbedtls/2.16.3-apache") if self.options.dtls_backend == "gnutls": raise ConanInvalidConfiguration("gnu tls not available yet") if self.options.dtls_backend == "tinydtls": From 582cfbd47463711cebd230e6be6a38dd0175e542 Mon Sep 17 00:00:00 2001 From: Carlos Gomes Martinho Date: Sat, 13 Jun 2020 12:05:46 +0200 Subject: [PATCH 18/30] style: fix new hooks --- recipes/libcoap/all/test_package/CMakeLists.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/recipes/libcoap/all/test_package/CMakeLists.txt b/recipes/libcoap/all/test_package/CMakeLists.txt index 4354080150986..e3410dbe322b9 100644 --- a/recipes/libcoap/all/test_package/CMakeLists.txt +++ b/recipes/libcoap/all/test_package/CMakeLists.txt @@ -1,8 +1,6 @@ cmake_minimum_required(VERSION 2.8.11) project(test_package) -set(CMAKE_VERBOSE_MAKEFILE TRUE) - include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup() From ac6e2197db692a699b4ac045e8711361e2cf9639 Mon Sep 17 00:00:00 2001 From: Carlos Gomes Martinho Date: Tue, 7 Jul 2020 16:27:06 +0200 Subject: [PATCH 19/30] Update recipes/libcoap/all/conanfile.py Co-authored-by: Michael "Croydon" Keck --- recipes/libcoap/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/libcoap/all/conanfile.py b/recipes/libcoap/all/conanfile.py index e52464c8e7882..3096727004e74 100644 --- a/recipes/libcoap/all/conanfile.py +++ b/recipes/libcoap/all/conanfile.py @@ -6,7 +6,7 @@ class LibCoapConan(ConanFile): name = "libcoap" license = "BSD-2-Clause" - homepage = "https://github.com/gocarlos/libcoap/" + homepage = "https://github.com/obgm/libcoap" url = "https://github.com/conan-io/conan-center-index" description = """A CoAP (RFC 7252) implementation in C""" topics = ("coap") From 5f55700b5cffe61c74d25d8072f230868129f3d6 Mon Sep 17 00:00:00 2001 From: Carlos Gomes Martinho Date: Sun, 23 Aug 2020 21:37:02 +0200 Subject: [PATCH 20/30] Update conandata.yml --- recipes/libcoap/all/conandata.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/libcoap/all/conandata.yml b/recipes/libcoap/all/conandata.yml index 9cb25e7c70429..17daed23722ed 100644 --- a/recipes/libcoap/all/conandata.yml +++ b/recipes/libcoap/all/conandata.yml @@ -1,4 +1,4 @@ sources: - "20200424": + "cci.20200424": sha256: 8402bf2dd9979d6d5f823a050cd3533619fe9b21e76be8c69a9b7d8b8ea175ab url: https://github.com/obgm/libcoap/archive/17957e1e687c2218b7752a8a959eac36dbf5cb62.zip From 0db20ffdf78d6ee916f531ceb387c13fd189ff17 Mon Sep 17 00:00:00 2001 From: Carlos Gomes Martinho Date: Sun, 23 Aug 2020 21:37:32 +0200 Subject: [PATCH 21/30] Update config.yml --- recipes/libcoap/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/libcoap/config.yml b/recipes/libcoap/config.yml index b08bca79f4402..1293823b59323 100644 --- a/recipes/libcoap/config.yml +++ b/recipes/libcoap/config.yml @@ -1,4 +1,4 @@ --- versions: - "20200424": + "cci.20200424": folder: "all" From f1ae5760a09fb93baef7f2d50dc6c310eba41be0 Mon Sep 17 00:00:00 2001 From: Carlos Gomes Martinho Date: Sun, 23 Aug 2020 21:38:01 +0200 Subject: [PATCH 22/30] Update CMakeLists.txt --- recipes/libcoap/all/test_package/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/libcoap/all/test_package/CMakeLists.txt b/recipes/libcoap/all/test_package/CMakeLists.txt index e3410dbe322b9..33ae887aa6aea 100644 --- a/recipes/libcoap/all/test_package/CMakeLists.txt +++ b/recipes/libcoap/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.11) +cmake_minimum_required(VERSION 3.1) project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) From 940d4789ecb434fffdfc7eb520d59579c2cef725 Mon Sep 17 00:00:00 2001 From: Carlos Gomes Martinho Date: Sun, 23 Aug 2020 21:38:36 +0200 Subject: [PATCH 23/30] Update CMakeLists.txt --- recipes/libcoap/all/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/libcoap/all/CMakeLists.txt b/recipes/libcoap/all/CMakeLists.txt index 361b35d4c17d9..bd3083b512cb9 100644 --- a/recipes/libcoap/all/CMakeLists.txt +++ b/recipes/libcoap/all/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.11) +cmake_minimum_required(VERSION 3.1) project(cmake_wrapper) include(conanbuildinfo.cmake) From c785fda8fb6336ac116e3aed969b2776f8e3e249 Mon Sep 17 00:00:00 2001 From: Carlos Gomes Martinho Date: Mon, 24 Aug 2020 20:37:25 +0200 Subject: [PATCH 24/30] Update conanfile.py --- recipes/libcoap/all/conanfile.py | 9 --------- 1 file changed, 9 deletions(-) diff --git a/recipes/libcoap/all/conanfile.py b/recipes/libcoap/all/conanfile.py index 3096727004e74..a3e65c7480ad5 100644 --- a/recipes/libcoap/all/conanfile.py +++ b/recipes/libcoap/all/conanfile.py @@ -46,14 +46,6 @@ def requirements(self): if self.options.dtls_backend == "tinydtls": raise ConanInvalidConfiguration("tinydtls not available yet") - def _patch_files(self): - # TODO: Remove custom targets when Conan components be available. - if self.options.dtls_backend == "openssl": - replace_ssl = 'OpenSSL::SSL' - tools.replace_in_file(os.path.join(self._source_subfolder, "CMakeLists.txt"), replace_ssl, "OpenSSL::OpenSSL") - replace_crypto = 'OpenSSL::Crypto' - tools.replace_in_file(os.path.join(self._source_subfolder, "CMakeLists.txt"), replace_crypto, "OpenSSL::OpenSSL") - def config_options(self): if self.settings.os == "Windows": del self.options.fPIC @@ -83,7 +75,6 @@ def _configure_cmake(self): return self._cmake def build(self): - self._patch_files() cmake = self._configure_cmake() cmake.build() From c3ea06529502df02f3fe5e9704c7f19d6291de34 Mon Sep 17 00:00:00 2001 From: Carlos Gomes Martinho Date: Wed, 26 Aug 2020 09:03:41 +0200 Subject: [PATCH 25/30] Update recipes/libcoap/all/conanfile.py Co-authored-by: Uilian Ries --- recipes/libcoap/all/conanfile.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/recipes/libcoap/all/conanfile.py b/recipes/libcoap/all/conanfile.py index a3e65c7480ad5..0623d80aa1db0 100644 --- a/recipes/libcoap/all/conanfile.py +++ b/recipes/libcoap/all/conanfile.py @@ -39,11 +39,11 @@ def _build_subfolder(self): def requirements(self): if self.options.dtls_backend == "openssl": self.requires("openssl/1.1.1g") - if self.options.dtls_backend == "mbedtls": + elif self.options.dtls_backend == "mbedtls": self.requires("mbedtls/2.16.3-apache") - if self.options.dtls_backend == "gnutls": + elif self.options.dtls_backend == "gnutls": raise ConanInvalidConfiguration("gnu tls not available yet") - if self.options.dtls_backend == "tinydtls": + elif self.options.dtls_backend == "tinydtls": raise ConanInvalidConfiguration("tinydtls not available yet") def config_options(self): From 88093467cdb90ec3eac57c9e78c088dd5ccfdb2b Mon Sep 17 00:00:00 2001 From: Carlos Gomes Martinho Date: Wed, 26 Aug 2020 09:03:51 +0200 Subject: [PATCH 26/30] Update recipes/libcoap/all/conanfile.py Co-authored-by: Uilian Ries --- recipes/libcoap/all/conanfile.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/recipes/libcoap/all/conanfile.py b/recipes/libcoap/all/conanfile.py index 0623d80aa1db0..65aa9b88ec8b2 100644 --- a/recipes/libcoap/all/conanfile.py +++ b/recipes/libcoap/all/conanfile.py @@ -88,9 +88,6 @@ def package(self): def package_info(self): self.cpp_info.libs = ["coap"] - if self.options.dtls_backend == None: - self.cpp_info.names['pkg_config'] = "libcoap-2" - else: - self.cpp_info.names['pkg_config'] = "libcoap-2-{}".format(self.options.dtls_backend) + self.cpp_info.names['pkg_config'] = "libcoap-2{}".format("" if not self.options.dtls_backend else "-" + self.options.dtls_backend) if self.settings.os == "Linux": self.cpp_info.system_libs = ["pthread"] From a917a607cf8daf6c3691b46ca300e8ce69a9f9dd Mon Sep 17 00:00:00 2001 From: Carlos Gomes Martinho Date: Wed, 26 Aug 2020 09:04:00 +0200 Subject: [PATCH 27/30] Update recipes/libcoap/all/conanfile.py Co-authored-by: Uilian Ries --- recipes/libcoap/all/conanfile.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/recipes/libcoap/all/conanfile.py b/recipes/libcoap/all/conanfile.py index 65aa9b88ec8b2..cd65e779a6dfd 100644 --- a/recipes/libcoap/all/conanfile.py +++ b/recipes/libcoap/all/conanfile.py @@ -53,7 +53,8 @@ def config_options(self): def configure(self): if self.settings.os in ("Windows", "Macos"): raise ConanInvalidConfiguration("Platform is currently not supported") - + if self.options.shared: + del self.options.fPIC del self.settings.compiler.libcxx del self.settings.compiler.cppstd From 62074c033d5078cb0cd31b3940acc6481849978a Mon Sep 17 00:00:00 2001 From: Carlos Gomes Martinho Date: Thu, 27 Aug 2020 07:57:56 +0200 Subject: [PATCH 28/30] Update recipes/libcoap/all/conanfile.py Co-authored-by: Anonymous Maarten --- recipes/libcoap/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/libcoap/all/conanfile.py b/recipes/libcoap/all/conanfile.py index cd65e779a6dfd..fa6dc7ef99f4f 100644 --- a/recipes/libcoap/all/conanfile.py +++ b/recipes/libcoap/all/conanfile.py @@ -89,6 +89,6 @@ def package(self): def package_info(self): self.cpp_info.libs = ["coap"] - self.cpp_info.names['pkg_config'] = "libcoap-2{}".format("" if not self.options.dtls_backend else "-" + self.options.dtls_backend) + self.cpp_info.names['pkg_config'] = "libcoap-2{}".format("-{}".format(self.options.dtls_backend) if self.options.dtls_backend else "") if self.settings.os == "Linux": self.cpp_info.system_libs = ["pthread"] From 13d145818825c7b0f3e42b50b6ba70f4acde7667 Mon Sep 17 00:00:00 2001 From: Carlos Gomes Martinho Date: Wed, 23 Sep 2020 22:52:32 +0200 Subject: [PATCH 29/30] Apply suggestions from code review Co-authored-by: SpaceIm <30052553+SpaceIm@users.noreply.github.com> --- recipes/libcoap/all/conanfile.py | 12 +++++++----- recipes/libcoap/all/test_package/CMakeLists.txt | 4 +++- recipes/libcoap/all/test_package/conanfile.py | 2 +- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/recipes/libcoap/all/conanfile.py b/recipes/libcoap/all/conanfile.py index fa6dc7ef99f4f..b551015ccb365 100644 --- a/recipes/libcoap/all/conanfile.py +++ b/recipes/libcoap/all/conanfile.py @@ -84,11 +84,13 @@ def package(self): cmake = self._configure_cmake() cmake.install() tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) - tools.rmdir(os.path.join(self.package_folder, - "lib", "libcoap", "cmake")) def package_info(self): - self.cpp_info.libs = ["coap"] - self.cpp_info.names['pkg_config'] = "libcoap-2{}".format("-{}".format(self.options.dtls_backend) if self.options.dtls_backend else "") + pkgconfig_filename = "libcoap-2{}".format("-{}".format(self.options.dtls_backend) if self.options.dtls_backend else "") + self.cpp_info.names["pkg_config"] = pkgconfig_filename + self.cpp_info.components["coap"].names["cmake_find_package"] = "coap" + self.cpp_info.components["coap"].names["cmake_find_package_multi"] = "coap" + self.cpp_info.components["coap"].names["pkg_config"] = pkgconfig_filename + self.cpp_info.components["coap"].libs = ["coap"] if self.settings.os == "Linux": - self.cpp_info.system_libs = ["pthread"] + self.cpp_info.components["coap"].system_libs = ["pthread"] diff --git a/recipes/libcoap/all/test_package/CMakeLists.txt b/recipes/libcoap/all/test_package/CMakeLists.txt index 33ae887aa6aea..a8acc4f57e48d 100644 --- a/recipes/libcoap/all/test_package/CMakeLists.txt +++ b/recipes/libcoap/all/test_package/CMakeLists.txt @@ -4,6 +4,8 @@ project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup() +find_package(libcoap REQUIRED CONFIG) + add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} libcoap::coap) set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/libcoap/all/test_package/conanfile.py b/recipes/libcoap/all/test_package/conanfile.py index 6c0a50e0f7678..6dffe66394a26 100644 --- a/recipes/libcoap/all/test_package/conanfile.py +++ b/recipes/libcoap/all/test_package/conanfile.py @@ -4,7 +4,7 @@ class TestConan(ConanFile): settings = "os", "compiler", "build_type", "arch" - generators = "cmake" + generators = "cmake", "cmake_find_package_multi" def build(self): cmake = CMake(self) From 7feb79887a64e336c057b805b5d2c3d0e9e90c0f Mon Sep 17 00:00:00 2001 From: Carlos Gomes Martinho Date: Tue, 29 Sep 2020 12:55:16 +0200 Subject: [PATCH 30/30] Apply suggestions from code review Co-authored-by: Chris Mc Co-authored-by: SpaceIm <30052553+SpaceIm@users.noreply.github.com> --- recipes/libcoap/all/conanfile.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/recipes/libcoap/all/conanfile.py b/recipes/libcoap/all/conanfile.py index b551015ccb365..88c964d612e68 100644 --- a/recipes/libcoap/all/conanfile.py +++ b/recipes/libcoap/all/conanfile.py @@ -38,7 +38,7 @@ def _build_subfolder(self): def requirements(self): if self.options.dtls_backend == "openssl": - self.requires("openssl/1.1.1g") + self.requires("openssl/1.1.1h") elif self.options.dtls_backend == "mbedtls": self.requires("mbedtls/2.16.3-apache") elif self.options.dtls_backend == "gnutls": @@ -94,3 +94,7 @@ def package_info(self): self.cpp_info.components["coap"].libs = ["coap"] if self.settings.os == "Linux": self.cpp_info.components["coap"].system_libs = ["pthread"] + if self.options.dtls_backend == "openssl": + self.cpp_info.components["coap"].requires = ["openssl::openssl"] + elif self.options.dtls_backend == "mbedtls": + self.cpp_info.components["coap"].requires = ["mbedtls::mbedtls"]