diff options
| author | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
|---|---|---|
| committer | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
| commit | 54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch) | |
| tree | d915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/libcoap | |
Diffstat (limited to 'vcpkg/ports/libcoap')
| -rw-r--r-- | vcpkg/ports/libcoap/portfile.cmake | 56 | ||||
| -rw-r--r-- | vcpkg/ports/libcoap/remove-hardcoded-tinydtls-path.patch | 14 | ||||
| -rw-r--r-- | vcpkg/ports/libcoap/vcpkg.json | 31 |
3 files changed, 101 insertions, 0 deletions
diff --git a/vcpkg/ports/libcoap/portfile.cmake b/vcpkg/ports/libcoap/portfile.cmake new file mode 100644 index 0000000..6f4b458 --- /dev/null +++ b/vcpkg/ports/libcoap/portfile.cmake @@ -0,0 +1,56 @@ +# dllexport is not supported.
+if(VCPKG_TARGET_IS_WINDOWS)
+ vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
+endif()
+
+vcpkg_download_distfile(DLLEXPORT_PATCH
+ URLS https://github.com/obgm/libcoap/commit/0bd03b658ed2d75fdb7cb8f6add201b39b428298.patch?full_index=1
+ FILENAME obgm-remove-self-configure-file-0bd03b658ed2d75fdb7cb8f6add201b39b428298.patch
+ SHA512 6c120dc278a5d73d0b9bd2f66468c822ccde80513262201119cdceb9ed6fdf2f84d473926373f18ef69d709d4e95212e484079072a52d5c65d09e4ccb82368e5
+)
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO obgm/libcoap
+ REF v4.3.5
+ SHA512 21332f4988c83cc3e26a70db6f2c3028e75fabc7990238d3c13666c5725674231799e147427b0fa827cf6c9e4d9f03d5176129f69425e2439ade13ea82267c05
+ HEAD_REF main
+ PATCHES
+ "${DLLEXPORT_PATCH}"
+ remove-hardcoded-tinydtls-path.patch)
+
+vcpkg_check_features(
+ OUT_FEATURE_OPTIONS FEATURE_OPTIONS
+ FEATURES
+ examples ENABLE_EXAMPLES
+ dtls ENABLE_DTLS
+)
+
+vcpkg_cmake_configure(
+ SOURCE_PATH ${SOURCE_PATH}
+ OPTIONS
+ ${FEATURE_OPTIONS}
+ -DENABLE_DOCS=OFF
+ -DDTLS_BACKEND=openssl)
+
+vcpkg_cmake_install()
+vcpkg_copy_pdbs()
+vcpkg_cmake_config_fixup(CONFIG_PATH "lib/cmake/libcoap")
+
+if("examples" IN_LIST FEATURES)
+ vcpkg_copy_tools(
+ TOOL_NAMES coap-client coap-rd coap-server
+ AUTO_CLEAN
+ )
+ # Same condition in licoap/CMakeLists.txt
+ if(NOT VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW)
+ vcpkg_copy_tools(
+ TOOL_NAMES etsi_iot_01 tiny oscore-interop-server
+ AUTO_CLEAN
+ )
+ endif()
+endif()
+
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
diff --git a/vcpkg/ports/libcoap/remove-hardcoded-tinydtls-path.patch b/vcpkg/ports/libcoap/remove-hardcoded-tinydtls-path.patch new file mode 100644 index 0000000..b7a48fd --- /dev/null +++ b/vcpkg/ports/libcoap/remove-hardcoded-tinydtls-path.patch @@ -0,0 +1,14 @@ +# A path to binary dir is hardcoded. +# tinydtls is never used because openssl is forced. +# Just remove the wrong line. +--- v4.3.5-4285a765ed.clean/CMakeLists.old.txt 2024-09-06 12:13:56.000000000 +0200 ++++ v4.3.5-4285a765ed.clean/CMakeLists.txt 2025-11-03 13:22:08.834295900 +0100 +@@ -808,7 +808,7 @@ target_include_directories( + $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include/> + $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include/> + $<INSTALL_INTERFACE:include/> +- $<$<AND:$<BOOL:${COAP_WITH_LIBTINYDTLS}>,$<BOOL:${USE_VENDORED_TINYDTLS}>>:${CMAKE_BINARY_DIR}/include/tinydtls> ++# $<$<AND:$<BOOL:${COAP_WITH_LIBTINYDTLS}>,$<BOOL:${USE_VENDORED_TINYDTLS}>>:${CMAKE_BINARY_DIR}/include/tinydtls> + $<$<BOOL:${COAP_WITH_LIBGNUTLS}>:${GNUTLS_INCLUDE_DIR}> + $<$<BOOL:${COAP_WITH_LIBMBEDTLS}>:${MBEDTLS_INCLUDE_DIRS}> + $<$<BOOL:${COAP_WITH_LIBWOLFSSL}>:${WOLFSSL_INCLUDE_DIR}>) diff --git a/vcpkg/ports/libcoap/vcpkg.json b/vcpkg/ports/libcoap/vcpkg.json new file mode 100644 index 0000000..0780183 --- /dev/null +++ b/vcpkg/ports/libcoap/vcpkg.json @@ -0,0 +1,31 @@ +{ + "name": "libcoap", + "version": "4.3.5", + "description": "libcoap — A C implementation of the Constrained Application Protocol (RFC 7252)", + "homepage": "https://libcoap.net/", + "license": "BSD-2-Clause", + "dependencies": [ + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ], + "default-features": [ + "dtls" + ], + "features": { + "dtls": { + "description": "compile with dtls support", + "dependencies": [ + "openssl" + ] + }, + "examples": { + "description": "Build examples" + } + } +} |