summaryrefslogtreecommitdiffstats
path: root/external/meta-iot-cloud/recipes-azure/azure-c-shared-utility
diff options
context:
space:
mode:
Diffstat (limited to 'external/meta-iot-cloud/recipes-azure/azure-c-shared-utility')
-rw-r--r--external/meta-iot-cloud/recipes-azure/azure-c-shared-utility/azure-c-shared-utility.inc38
-rw-r--r--external/meta-iot-cloud/recipes-azure/azure-c-shared-utility/azure-c-shared-utility_1.1.12.bb15
-rw-r--r--external/meta-iot-cloud/recipes-azure/azure-c-shared-utility/files/Fix-packaging-issues.patch43
-rw-r--r--external/meta-iot-cloud/recipes-azure/azure-c-shared-utility/files/Use-pkg-config-to-find-libs.patch72
4 files changed, 168 insertions, 0 deletions
diff --git a/external/meta-iot-cloud/recipes-azure/azure-c-shared-utility/azure-c-shared-utility.inc b/external/meta-iot-cloud/recipes-azure/azure-c-shared-utility/azure-c-shared-utility.inc
new file mode 100644
index 00000000..784e19f2
--- /dev/null
+++ b/external/meta-iot-cloud/recipes-azure/azure-c-shared-utility/azure-c-shared-utility.inc
@@ -0,0 +1,38 @@
+inherit cmake
+
+DEPENDS = "\
+ azure-macro-utils-c \
+ curl \
+ openssl \
+ umock-c \
+ util-linux \
+"
+
+RDEPENDS_${PN} = "\
+ util-linux-libuuid \
+"
+
+SRC_URI += "\
+ file://Fix-packaging-issues.patch \
+ file://Use-pkg-config-to-find-libs.patch \
+"
+
+S = "${WORKDIR}/git"
+B = "${WORKDIR}/build"
+
+EXTRA_OECMAKE = "\
+ -Dbuild_as_dynamic:BOOL=ON \
+ -Dskip_samples:BOOL=ON \
+ -Duse_installed_dependencies:BOOL=ON \
+ -Drun_unittests:BOOL=OFF \
+"
+
+sysroot_stage_all_append () {
+ sysroot_stage_dir ${D}${exec_prefix}/cmake ${SYSROOT_DESTDIR}${exec_prefix}/cmake
+}
+
+FILES_${PN}-dev += "\
+ ${exec_prefix}/cmake \
+"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/external/meta-iot-cloud/recipes-azure/azure-c-shared-utility/azure-c-shared-utility_1.1.12.bb b/external/meta-iot-cloud/recipes-azure/azure-c-shared-utility/azure-c-shared-utility_1.1.12.bb
new file mode 100644
index 00000000..59b69b78
--- /dev/null
+++ b/external/meta-iot-cloud/recipes-azure/azure-c-shared-utility/azure-c-shared-utility_1.1.12.bb
@@ -0,0 +1,15 @@
+DESCRIPTION = "Azure C Shared Utility"
+AUTHOR = "Microsoft Corporation"
+HOMEPAGE = "https://github.com/Azure/azure-c-shared-utility"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=4283671594edec4c13aeb073c219237a"
+
+SRC_URI = "\
+ git://github.com/Azure/azure-c-shared-utility.git \
+"
+
+SRCREV = "48f7a556865731f0e96c47eb5e9537361f24647c"
+
+PR = "r0"
+
+require ${BPN}.inc
diff --git a/external/meta-iot-cloud/recipes-azure/azure-c-shared-utility/files/Fix-packaging-issues.patch b/external/meta-iot-cloud/recipes-azure/azure-c-shared-utility/files/Fix-packaging-issues.patch
new file mode 100644
index 00000000..eaa89963
--- /dev/null
+++ b/external/meta-iot-cloud/recipes-azure/azure-c-shared-utility/files/Fix-packaging-issues.patch
@@ -0,0 +1,43 @@
+From b26fc183207b583d5fb7f60015bb46752cd60706 Mon Sep 17 00:00:00 2001
+From: Scott Ware <scott.r.ware@intel.com>
+Date: Tue, 7 Apr 2020 20:55:05 +0100
+Subject: [PATCH 1/2] Fix packaging issues
+
+Signed-off-by: Scott Ware <scott.r.ware@intel.com>
+---
+ CMakeLists.txt | 12 +++++++++++-
+ 1 file changed, 11 insertions(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 263974b..5251ffe 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -11,6 +11,9 @@ project(azure_c_shared_utility)
+
+ FILE(READ ${CMAKE_CURRENT_LIST_DIR}/version.txt C_SHARED_VERSION)
+
++set(GENERIC_LIB_VERSION ${C_SHARED_VERSION})
++string(SUBSTRING ${C_SHARED_VERSION} 0 1 GENERIC_LIB_SOVERSION)
++
+ # Include the common build rules for the C SDK
+ include(configs/azure_iot_build_rules.cmake)
+
+@@ -487,7 +490,14 @@ if(${build_as_dynamic})
+ ${source_h_files}
+ ${def_files}
+ )
+- set_target_properties(aziotsharedutil_dll PROPERTIES OUTPUT_NAME "aziotsharedutil_dll")
++ if (NOT WIN32)
++ set_target_properties(aziotsharedutil_dll
++ PROPERTIES
++ OUTPUT_NAME "aziotsharedutil"
++ VERSION ${GENERIC_LIB_VERSION}
++ SOVERSION ${GENERIC_LIB_SOVERSION}
++ )
++ endif ()
+ endif()
+
+ set(aziotsharedutil_target_libs)
+--
+2.7.4
+
diff --git a/external/meta-iot-cloud/recipes-azure/azure-c-shared-utility/files/Use-pkg-config-to-find-libs.patch b/external/meta-iot-cloud/recipes-azure/azure-c-shared-utility/files/Use-pkg-config-to-find-libs.patch
new file mode 100644
index 00000000..000359be
--- /dev/null
+++ b/external/meta-iot-cloud/recipes-azure/azure-c-shared-utility/files/Use-pkg-config-to-find-libs.patch
@@ -0,0 +1,72 @@
+From 03947c2a47bf7458ed093355e71a4f411a725330 Mon Sep 17 00:00:00 2001
+From: Scott Ware <scott.r.ware@intel.com>
+Date: Tue, 7 Apr 2020 20:59:53 +0100
+Subject: [PATCH 2/2] Use pkg-config to find libs
+
+Signed-off-by: Scott Ware <scott.r.ware@intel.com>
+---
+ CMakeLists.txt | 31 ++++++++++---------------------
+ 1 file changed, 10 insertions(+), 21 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 5251ffe..52ab416 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -116,9 +116,13 @@ if(${use_openssl})
+ # If OpenSSL::SSL OR OpenSSL::Crypto are not set then you need to run
+ # the find package for openssl
+ if (NOT TARGET OpenSSL::SSL OR NOT TARGET OpenSSL::Crypto OR NOT ${OPENSSL_INCLUDE_DIR})
+- find_package(OpenSSL REQUIRED)
++ find_package(PkgConfig)
++ if(PKG_CONFIG_FOUND)
++ pkg_check_modules(OPENSSL libssl)
++ pkg_check_modules(CRYPTO libcrypto)
++ endif()
+ endif()
+- include_directories(${OPENSSL_INCLUDE_DIR})
++ include_directories(${OPENSSL_INCLUDE_DIR} ${CRYPTO_INCLUDE_DIR})
+ endif()
+
+ if(${use_applessl})
+@@ -511,26 +515,11 @@ if(${use_http})
+ set(aziotsharedutil_target_libs ${aziotsharedutil_target_libs} crypt32 winhttp)
+ else()
+ if (NOT use_builtin_httpapi)
+- if (CMAKE_CROSSCOMPILING)
+- # As mentioned at https://cmake.org/Wiki/CMake_Cross_Compiling the
+- # pkg-config tool can not be used by cmake while cross compiling.
+- message(STATUS "Cross compiling not using pkg-config")
+- else()
+- # try pkg-config first
+- find_package(PkgConfig)
+- if(PKG_CONFIG_FOUND)
+- pkg_check_modules(CURL libcurl)
+- endif()
+- endif()
+-
+- # if that didn't work, try CMake find_package
+- if(NOT CURL_FOUND)
+- find_package(CURL)
++ find_package(PkgConfig)
++ if(PKG_CONFIG_FOUND)
++ pkg_check_modules(CURL libcurl)
+ endif()
+
+- set(CURL_FIND_REQUIRED 1)
+- find_package_handle_standard_args(CURL DEFAULT_MSG CURL_LIBRARIES)
+-
+ include_directories(${CURL_INCLUDE_DIRS})
+ set(aziotsharedutil_target_libs ${aziotsharedutil_target_libs} ${CURL_LIBRARIES})
+ endif(NOT use_builtin_httpapi)
+@@ -571,7 +560,7 @@ if(${use_bearssl})
+ endif()
+
+ if(${use_openssl})
+- set(aziotsharedutil_target_libs ${aziotsharedutil_target_libs} ${OPENSSL_LIBRARIES})
++ set(aziotsharedutil_target_libs ${aziotsharedutil_target_libs} ${OPENSSL_LIBRARIES} ${CRYPTO_LIBRARIES})
+ if (WIN32)
+ set(aziotsharedutil_target_libs ${aziotsharedutil_target_libs} crypt32 ws2_32 secur32)
+ endif()
+--
+2.7.4
+