Skip to content

Commit 1d799f8

Browse files
committed
azure-iot-sdk-c: Update to latest LTS packages
Signed-off-by: Scott Ware <[email protected]>
1 parent 1633383 commit 1d799f8

18 files changed

+123
-249
lines changed

recipes-azure/azure-c-shared-utility/azure-c-shared-utility.inc

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
inherit cmake
1+
inherit cmake pkgconfig
22

33
DEPENDS = "\
44
azure-macro-utils-c \
@@ -13,10 +13,9 @@ RDEPENDS:${PN} = "\
1313
"
1414

1515
SRC_URI += "\
16-
file://Fix-packaging-issues.patch \
17-
file://Use-pkg-config-to-find-libs.patch \
18-
file://0001-hmac.c-fix-compile-error-for-digest-pointer-vs-array.patch \
19-
file://0001-Fix-openssl-3.x-compatibility.patch \
16+
file://0001-Fix-packaging-issues.patch \
17+
file://0002-Use-pkg-config-to-find-libs.patch \
18+
file://0003-Fix-include-paths.patch \
2019
"
2120

2221
S = "${WORKDIR}/git"

recipes-azure/azure-c-shared-utility/azure-c-shared-utility_git.bb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ HOMEPAGE = "https://github.com/Azure/azure-c-shared-utility"
44
LICENSE = "MIT"
55
LIC_FILES_CHKSUM = "file://LICENSE;md5=4283671594edec4c13aeb073c219237a"
66

7-
BRANCH = "lts_07_2020"
7+
BRANCH = "master"
88
SRC_URI = "\
99
git://github.com/Azure/azure-c-shared-utility.git;protocol=https;branch=${BRANCH} \
1010
"
1111

12-
SRCREV = "85fe8977e98cc0e84609e9250ba34b0d455b96df"
12+
SRCREV = "ceeafc67441b5b6a6d3ea32cf4bf3bcb3fa760af"
1313

14-
PV = "${BRANCH}+git${SRCPV}"
14+
PV = "1.1.12+git${SRCPV}"
1515

1616
require ${BPN}.inc

recipes-azure/azure-c-shared-utility/files/0001-Fix-openssl-3.x-compatibility.patch

Lines changed: 0 additions & 73 deletions
This file was deleted.

recipes-azure/azure-c-shared-utility/files/Fix-packaging-issues.patch renamed to recipes-azure/azure-c-shared-utility/files/0001-Fix-packaging-issues.patch

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
From b26fc183207b583d5fb7f60015bb46752cd60706 Mon Sep 17 00:00:00 2001
1+
From 6141c65ed260d46fab602d8fe5a84d143f24370e Mon Sep 17 00:00:00 2001
22
From: Scott Ware <[email protected]>
3-
Date: Tue, 7 Apr 2020 20:55:05 +0100
4-
Subject: [PATCH 1/2] Fix packaging issues
3+
Date: Sun, 21 Apr 2024 21:52:22 +0100
4+
Subject: [PATCH] Fix packaging issues
55

66
Upstream-Status: Pending
77

@@ -11,7 +11,7 @@ Signed-off-by: Scott Ware <[email protected]>
1111
1 file changed, 11 insertions(+), 1 deletion(-)
1212

1313
diff --git a/CMakeLists.txt b/CMakeLists.txt
14-
index 263974b..5251ffe 100644
14+
index 85220955..00e79a95 100755
1515
--- a/CMakeLists.txt
1616
+++ b/CMakeLists.txt
1717
@@ -11,6 +11,9 @@ project(azure_c_shared_utility)
@@ -24,7 +24,7 @@ index 263974b..5251ffe 100644
2424
# Include the common build rules for the C SDK
2525
include(configs/azure_iot_build_rules.cmake)
2626

27-
@@ -487,7 +490,14 @@ if(${build_as_dynamic})
27+
@@ -519,7 +522,14 @@ if(${build_as_dynamic})
2828
${source_h_files}
2929
${def_files}
3030
)
@@ -40,6 +40,3 @@ index 263974b..5251ffe 100644
4040
endif()
4141

4242
set(aziotsharedutil_target_libs)
43-
--
44-
2.7.4
45-

recipes-azure/azure-c-shared-utility/files/0001-hmac.c-fix-compile-error-for-digest-pointer-vs-array.patch

Lines changed: 0 additions & 36 deletions
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,21 @@
1-
From fea2b8280b0889b5c03f628c498cae7125f2a64c Mon Sep 17 00:00:00 2001
1+
From 3fe99f466679a9876cd264f7a07f1ca37fe6c15f Mon Sep 17 00:00:00 2001
22
From: Scott Ware <[email protected]>
3-
Date: Tue, 7 Apr 2020 20:59:53 +0100
3+
Date: Mon, 22 Apr 2024 09:33:47 +0100
44
Subject: [PATCH] Use pkg-config to find libs
55

6-
Signed-off-by: Scott Ware <[email protected]>
7-
8-
Add link options to cmake configs. Other package (such as
9-
azure-iot-sdk-c) link library of azure-c-shared-utility
10-
with these options to avoid the following error
11-
...
12-
ld: iothub_client/libiothub_client.so.1.4.1: undefined reference to `ERR_load_BIO_strings'
13-
collect2: error: ld returned 1 exit status
14-
...
15-
16-
Upstream-Status: Inappropriate [oe specific]
6+
Upstream-Status: Pending
177

18-
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
8+
Signed-off-by: Scott Ware <scott.r.ware@intel.com>
199
---
20-
CMakeLists.txt | 31 ++++++++++-------------------
10+
CMakeLists.txt | 30 ++++++++++-------------------
2111
configs/azure_iot_build_rules.cmake | 5 +++++
22-
2 files changed, 15 insertions(+), 21 deletions(-)
12+
2 files changed, 15 insertions(+), 20 deletions(-)
2313

2414
diff --git a/CMakeLists.txt b/CMakeLists.txt
25-
index e7078fee..c8c0f9d5 100644
15+
index 00e79a95..eef28e29 100755
2616
--- a/CMakeLists.txt
2717
+++ b/CMakeLists.txt
28-
@@ -116,9 +116,13 @@ if(${use_openssl})
18+
@@ -126,7 +126,11 @@ if(${use_openssl})
2919
# If OpenSSL::SSL OR OpenSSL::Crypto are not set then you need to run
3020
# the find package for openssl
3121
if (NOT TARGET OpenSSL::SSL OR NOT TARGET OpenSSL::Crypto OR NOT ${OPENSSL_INCLUDE_DIR})
@@ -36,30 +26,35 @@ index e7078fee..c8c0f9d5 100644
3626
+ pkg_check_modules(CRYPTO libcrypto)
3727
+ endif()
3828
endif()
29+
30+
# The block below enables the v1 back-compatibility layer in OpenSSL 3,
31+
@@ -136,7 +140,7 @@ if(${use_openssl})
32+
add_definitions(-DOPENSSL_API_COMPAT=0x10101000L)
33+
endif()
34+
3935
- include_directories(${OPENSSL_INCLUDE_DIR})
4036
+ include_directories(${OPENSSL_INCLUDE_DIR} ${CRYPTO_INCLUDE_DIR})
4137
endif()
4238

4339
if(${use_applessl})
44-
@@ -511,26 +515,11 @@ if(${use_http})
40+
@@ -543,25 +547,11 @@ if(${use_http})
4541
set(aziotsharedutil_target_libs ${aziotsharedutil_target_libs} crypt32 winhttp)
4642
else()
4743
if (NOT use_builtin_httpapi)
48-
- if (CMAKE_CROSSCOMPILING)
49-
- # As mentioned at https://cmake.org/Wiki/CMake_Cross_Compiling the
50-
- # pkg-config tool can not be used by cmake while cross compiling.
51-
- message(STATUS "Cross compiling not using pkg-config")
52-
- else()
53-
- # try pkg-config first
54-
- find_package(PkgConfig)
55-
- if(PKG_CONFIG_FOUND)
56-
- pkg_check_modules(CURL libcurl)
57-
- endif()
58-
- endif()
5944
-
60-
- # if that didn't work, try CMake find_package
61-
- if(NOT CURL_FOUND)
62-
- find_package(CURL)
45+
- # try CMake find_package first
46+
- find_package(CURL)
47+
-
48+
- # As mentioned at https://cmake.org/Wiki/CMake_Cross_Compiling the
49+
- # pkg-config tool can not be used by cmake while cross compiling.
50+
- if (NOT CMAKE_CROSSCOMPILING)
51+
- # if find_package didn't work, try pkg-config
52+
- if(NOT CURL_FOUND)
53+
- find_package(PkgConfig)
54+
- if(PKG_CONFIG_FOUND)
55+
- pkg_check_modules(CURL libcurl)
56+
- endif()
57+
- endif()
6358
+ find_package(PkgConfig)
6459
+ if(PKG_CONFIG_FOUND)
6560
+ pkg_check_modules(CURL libcurl)
@@ -71,7 +66,7 @@ index e7078fee..c8c0f9d5 100644
7166
include_directories(${CURL_INCLUDE_DIRS})
7267
set(aziotsharedutil_target_libs ${aziotsharedutil_target_libs} ${CURL_LIBRARIES})
7368
endif(NOT use_builtin_httpapi)
74-
@@ -571,7 +560,7 @@ if(${use_bearssl})
69+
@@ -602,7 +592,7 @@ if(${use_bearssl})
7570
endif()
7671

7772
if(${use_openssl})
@@ -81,12 +76,12 @@ index e7078fee..c8c0f9d5 100644
8176
set(aziotsharedutil_target_libs ${aziotsharedutil_target_libs} crypt32 ws2_32 secur32)
8277
endif()
8378
diff --git a/configs/azure_iot_build_rules.cmake b/configs/azure_iot_build_rules.cmake
84-
index be3e14fe..4f85a2b8 100644
79+
index 655b7f01..747fd256 100644
8580
--- a/configs/azure_iot_build_rules.cmake
8681
+++ b/configs/azure_iot_build_rules.cmake
87-
@@ -76,6 +76,11 @@ elseif(UNIX) #LINUX OR APPLE
88-
if(NOT (IN_OPENWRT OR APPLE))
89-
set (CMAKE_C_FLAGS "-D_POSIX_C_SOURCE=200112L ${CMAKE_C_FLAGS}")
82+
@@ -77,6 +77,11 @@ elseif(UNIX) #LINUX OR APPLE
83+
# _XOPEN_SOURCE=500 is required for glibc to expose random and srandom.
84+
set (CMAKE_C_FLAGS "-D_POSIX_C_SOURCE=200112L -D_XOPEN_SOURCE=500 ${CMAKE_C_FLAGS}")
9085
endif()
9186
+
9287
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -lssl -lcrypto")
@@ -96,6 +91,3 @@ index be3e14fe..4f85a2b8 100644
9691
endif()
9792

9893
enable_testing()
99-
--
100-
2.27.0
101-
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
From f63a8f5454f772e3bd87b27e349464d3829dc36d Mon Sep 17 00:00:00 2001
2+
From: Scott Ware <[email protected]>
3+
Date: Mon, 22 Apr 2024 13:31:34 +0100
4+
Subject: [PATCH] Fix include paths
5+
6+
Upstream-Status: Pending
7+
8+
Signed-off-by: Scott Ware <[email protected]>
9+
---
10+
CMakeLists.txt | 2 +-
11+
1 file changed, 1 insertion(+), 1 deletion(-)
12+
13+
diff --git a/CMakeLists.txt b/CMakeLists.txt
14+
index eef28e29..08039dc3 100755
15+
--- a/CMakeLists.txt
16+
+++ b/CMakeLists.txt
17+
@@ -726,7 +726,7 @@ install (TARGETS ${targets} EXPORT aziotsharedutilTargets
18+
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
19+
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
20+
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
21+
- INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/azureiot
22+
+ INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
23+
)
24+
install (FILES ${source_h_files} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/azure_c_shared_utility)
25+
install (FILES ${micromock_h_files_full_path} ${INSTALL_H_FILES} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/azureiot)

recipes-azure/azure-iot-sdk-c/azure-iot-sdk-c.inc

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,10 @@ DEPENDS = "\
77
parson \
88
"
99

10-
SRC_URI += "\
11-
file://Fix-cmake-build-issues.patch \
12-
file://Use-provided-parson-lib.patch \
13-
file://0001-serializer-samples-Disable-devicetwin_simplesample.patch \
14-
"
10+
#SRC_URI += "\
11+
# file://Fix-cmake-build-issues.patch \
12+
# file://Use-provided-parson-lib.patch \
13+
#"
1514

1615
S = "${WORKDIR}/git"
1716
B = "${WORKDIR}/build"
@@ -24,22 +23,14 @@ PACKAGECONFIG[mqtt] = "-Duse_mqtt:BOOL=ON, -Duse_mqtt:BOOL=OFF, azure-umqtt-c"
2423

2524
EXTRA_OECMAKE = "\
2625
-Dbuild_as_dynamic:BOOL=ON \
27-
-Dskip_samples:BOOL=OFF \
26+
-Dskip_samples:BOOL=ON \
2827
-Duse_installed_dependencies:BOOL=ON \
2928
-Dbuild_service_client:BOOL=OFF \
3029
-Dbuild_provisioning_service_client:BOOL=OFF \
30+
-Drun_e2e_tests:BOOL=OFF \
31+
-Dhsm_type_sastoken:BOOL=OFF \
3132
"
3233

33-
do_install:append() {
34-
# Install samples
35-
for sample in `find ${B} -perm 0755 -type f -path '*/samples/*'`; do
36-
if [ ! -e ${D}${bindir} ]; then
37-
install -m 0755 -d ${D}${bindir}
38-
fi
39-
install -m 0755 $sample ${D}${bindir}
40-
done
41-
}
42-
4334
sysroot_stage_all:append () {
4435
sysroot_stage_dir ${D}${exec_prefix}/cmake ${SYSROOT_DESTDIR}${exec_prefix}/cmake
4536
}
@@ -48,8 +39,4 @@ FILES:${PN}-dev += "\
4839
${exec_prefix}/cmake \
4940
"
5041

51-
FILES:${PN}-samples += " \
52-
${bindir} \
53-
"
54-
5542
BBCLASSEXTEND = "native nativesdk"

0 commit comments

Comments
 (0)