aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/azure-iot-sdk-c
diff options
context:
space:
mode:
Diffstat (limited to 'vcpkg/ports/azure-iot-sdk-c')
-rw-r--r--vcpkg/ports/azure-iot-sdk-c/fix-install-location.patch40
-rw-r--r--vcpkg/ports/azure-iot-sdk-c/fix-iothubclient-includes.patch14
-rw-r--r--vcpkg/ports/azure-iot-sdk-c/improve-external-deps.patch63
-rw-r--r--vcpkg/ports/azure-iot-sdk-c/portfile.cmake47
-rw-r--r--vcpkg/ports/azure-iot-sdk-c/vcpkg.json29
5 files changed, 193 insertions, 0 deletions
diff --git a/vcpkg/ports/azure-iot-sdk-c/fix-install-location.patch b/vcpkg/ports/azure-iot-sdk-c/fix-install-location.patch
new file mode 100644
index 0000000..aeb0c81
--- /dev/null
+++ b/vcpkg/ports/azure-iot-sdk-c/fix-install-location.patch
@@ -0,0 +1,40 @@
+diff --git a/provisioning_client/CMakeLists.txt b/provisioning_client/CMakeLists.txt
+index 39f269d51..ff53ca32d 100644
+--- a/provisioning_client/CMakeLists.txt
++++ b/provisioning_client/CMakeLists.txt
+@@ -357,7 +357,7 @@ if(${use_installed_dependencies})
+ set(CMAKE_INSTALL_LIBDIR "lib")
+ endif()
+
+- install(TARGETS ${provisioning_libs} EXPORT azure_prov_sdksTargets
++ install(TARGETS ${provisioning_libs} EXPORT azure_iot_sdksTargets
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
+@@ -372,26 +372,6 @@ if(${use_installed_dependencies})
+ VERSION ${PROV_SDK_VERSION}
+ COMPATIBILITY SameMajorVersion
+ )
+-
+- configure_file("../configs/${PROJECT_NAME}Config.cmake"
+- "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}/${PROJECT_NAME}Config.cmake"
+- COPYONLY
+- )
+-
+- install(EXPORT azure_prov_sdksTargets
+- FILE
+- "${PROJECT_NAME}Targets.cmake"
+- DESTINATION
+- ${package_location}
+- )
+-
+- install(
+- FILES
+- "../configs/${PROJECT_NAME}Config.cmake"
+- "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}/${PROJECT_NAME}ConfigVersion.cmake"
+- DESTINATION
+- ${package_location}
+- )
+ else()
+ # Install Provisioning libs
+ if(NOT DEFINED CMAKE_INSTALL_LIBDIR)
diff --git a/vcpkg/ports/azure-iot-sdk-c/fix-iothubclient-includes.patch b/vcpkg/ports/azure-iot-sdk-c/fix-iothubclient-includes.patch
new file mode 100644
index 0000000..1a51736
--- /dev/null
+++ b/vcpkg/ports/azure-iot-sdk-c/fix-iothubclient-includes.patch
@@ -0,0 +1,14 @@
+diff --git a/iothub_client/CMakeLists.txt b/iothub_client/CMakeLists.txt
+index 5a8f5573c..07ab3b7cb 100644
+--- a/iothub_client/CMakeLists.txt
++++ b/iothub_client/CMakeLists.txt
+@@ -442,8 +442,6 @@ target_include_directories(iothub_client
+ PUBLIC
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/inc>
+- $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/azureiot/include>
++ $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/azureiot>
+- $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/deps/umock-c/inc>
+- $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/deps/azure-macro-utils-c/inc>
+ )
+ applyXcodeBuildFlagsIfNeeded(iothub_client)
+ target_link_libraries(iothub_client ${iothub_client_libs})
diff --git a/vcpkg/ports/azure-iot-sdk-c/improve-external-deps.patch b/vcpkg/ports/azure-iot-sdk-c/improve-external-deps.patch
new file mode 100644
index 0000000..0dbd27c
--- /dev/null
+++ b/vcpkg/ports/azure-iot-sdk-c/improve-external-deps.patch
@@ -0,0 +1,63 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 427e82e..5a58e47 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -257,6 +257,9 @@ add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/deps)
+ if(${use_installed_dependencies})
+ find_package(parson REQUIRED CONFIG)
+ endif()
++if(NOT TARGET parson)
++ add_library(parson ALIAS parson::parson)
++endif()
+
+ include_directories(${MACRO_UTILS_INC_FOLDER})
+ include_directories(${UMOCK_C_INC_FOLDER})
+diff --git a/configs/azure_iot_sdksConfig.cmake b/configs/azure_iot_sdksConfig.cmake
+index b9c62e8..edf5847 100644
+--- a/configs/azure_iot_sdksConfig.cmake
++++ b/configs/azure_iot_sdksConfig.cmake
+@@ -1,5 +1,11 @@
+ #Copyright (c) Microsoft. All rights reserved.
+ #Licensed under the MIT license. See LICENSE file in the project root for full license information.
++include(CMakeFindDependencyMacro)
++find_dependency(parson)
++find_dependency(uamqp)
++find_dependency(uhttp)
++find_dependency(umqtt)
++find_dependency(azure_c_shared_utility)
+
+ include("${CMAKE_CURRENT_LIST_DIR}/azure_iot_sdksTargets.cmake")
+
+diff --git a/iothub_client/tests/iothubclient_amqp_dt_e2e/CMakeLists.txt b/iothub_client/tests/iothubclient_amqp_dt_e2e/CMakeLists.txt
+index 33b5b8709..45ef7b87a 100644
+--- a/iothub_client/tests/iothubclient_amqp_dt_e2e/CMakeLists.txt
++++ b/iothub_client/tests/iothubclient_amqp_dt_e2e/CMakeLists.txt
+@@ -22,11 +22,9 @@ set(${theseTestsName}_c_files
+
+ set(${theseTestsName}_c_files
+ ../../../certs/certs.c
+- ../../../deps/parson/parson.c
+ )
+ set(${theseTestsName}_h_files
+ ../../../certs/certs.h
+- ../../../deps/parson/parson.h
+ ../common_dt_e2e/iothubclient_common_dt_e2e.h
+ )
+
+diff --git a/iothub_client/tests/iothubclient_mqtt_dt_e2e_sfc/CMakeLists.txt b/iothub_client/tests/iothubclient_mqtt_dt_e2e_sfc/CMakeLists.txt
+index d05d654..5872c8d 100644
+--- a/iothub_client/tests/iothubclient_mqtt_dt_e2e_sfc/CMakeLists.txt
++++ b/iothub_client/tests/iothubclient_mqtt_dt_e2e_sfc/CMakeLists.txt
+@@ -22,12 +22,10 @@ set(${theseTestsName}_nuget_c_files
+
+ set(${theseTestsName}_c_files
+ ../../../certs/certs.c
+- ../../../deps/parson/parson.c
+ )
+
+ set(${theseTestsName}_h_files
+ ../../../certs/certs.h
+- ../../../deps/parson/parson.h
+ ../common_dt_e2e/iothubclient_common_dt_e2e.h
+ )
+
diff --git a/vcpkg/ports/azure-iot-sdk-c/portfile.cmake b/vcpkg/ports/azure-iot-sdk-c/portfile.cmake
new file mode 100644
index 0000000..863228b
--- /dev/null
+++ b/vcpkg/ports/azure-iot-sdk-c/portfile.cmake
@@ -0,0 +1,47 @@
+vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO Azure/azure-iot-sdk-c
+ REF 79145b2cf2050b3a10d22003156db86f6e9c5c5e
+ SHA512 771950d5472eaf49edd032ac987ea65aee8b9ef7c481c5fb8c3e1b3fb1efabcdce309e6a107949f34f78edea9704854a3791b111dce729c53fa0f041da352fb1
+ HEAD_REF master
+ PATCHES
+ fix-install-location.patch
+ improve-external-deps.patch
+ fix-iothubclient-includes.patch
+)
+
+vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
+ FEATURES
+ use-prov-client hsm_type_symm_key
+ use-prov-client use_prov_client
+)
+
+file(COPY "${CURRENT_INSTALLED_DIR}/share/azure-c-shared-utility/azure_iot_build_rules.cmake" DESTINATION "${SOURCE_PATH}/deps/azure-c-shared-utility/configs/")
+file(COPY "${SOURCE_PATH}/configs/azure_iot_sdksFunctions.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/cmake/azure_iot_sdks/")
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ OPTIONS ${FEATURE_OPTIONS}
+ -Dskip_samples=ON
+ -Duse_installed_dependencies=ON
+ -Duse_default_uuid=ON
+ -Dbuild_as_dynamic=OFF
+ -Duse_edge_modules=ON
+ -Dwarnings_as_errors=OFF
+ -Dhsm_type_sastoken=OFF
+ MAYBE_UNUSED_VARIABLES
+ build_as_dynamic
+ warnings_as_errors
+)
+
+vcpkg_cmake_install()
+
+vcpkg_cmake_config_fixup(PACKAGE_NAME azure_iot_sdks CONFIG_PATH "lib/cmake/azure_iot_sdks")
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" "${CURRENT_PACKAGES_DIR}/debug/share")
+
+configure_file("${SOURCE_PATH}/LICENSE" "${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright" COPYONLY)
+
+vcpkg_copy_pdbs()
diff --git a/vcpkg/ports/azure-iot-sdk-c/vcpkg.json b/vcpkg/ports/azure-iot-sdk-c/vcpkg.json
new file mode 100644
index 0000000..0e2dcf5
--- /dev/null
+++ b/vcpkg/ports/azure-iot-sdk-c/vcpkg.json
@@ -0,0 +1,29 @@
+{
+ "name": "azure-iot-sdk-c",
+ "version-date": "2025-03-31",
+ "description": "A C99 SDK for connecting devices to Microsoft Azure IoT services",
+ "homepage": "https://github.com/Azure/azure-iot-sdk-c",
+ "license": "MIT",
+ "dependencies": [
+ "azure-c-shared-utility",
+ "azure-macro-utils-c",
+ "azure-uamqp-c",
+ "azure-uhttp-c",
+ "azure-umqtt-c",
+ "parson",
+ "umock-c",
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ },
+ {
+ "name": "vcpkg-cmake-config",
+ "host": true
+ }
+ ],
+ "features": {
+ "use-prov-client": {
+ "description": "Enables device provisioning client for DPS"
+ }
+ }
+}