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/libjuice | |
Diffstat (limited to 'vcpkg/ports/libjuice')
| -rw-r--r-- | vcpkg/ports/libjuice/dependencies.diff | 44 | ||||
| -rw-r--r-- | vcpkg/ports/libjuice/portfile.cmake | 33 | ||||
| -rw-r--r-- | vcpkg/ports/libjuice/vcpkg.json | 25 |
3 files changed, 102 insertions, 0 deletions
diff --git a/vcpkg/ports/libjuice/dependencies.diff b/vcpkg/ports/libjuice/dependencies.diff new file mode 100644 index 0000000..f6f7b95 --- /dev/null +++ b/vcpkg/ports/libjuice/dependencies.diff @@ -0,0 +1,44 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 5712462..dd6c669 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -120,11 +120,14 @@ if(WIN32) + endif() + + if (USE_NETTLE) +- find_package(Nettle REQUIRED) ++ find_path(NETTLE_INCLUDE_PATH "nettle/hmac.h" REQUIRED) ++ find_library(NETTLE_LIBRARY_PATH NAMES nettle libnettle NAMES_PER_DIR REQUIRED) ++ target_include_directories(juice PRIVATE ${NETTLE_INCLUDE_PATH}) ++ target_include_directories(juice-static PRIVATE ${NETTLE_INCLUDE_PATH}) + target_compile_definitions(juice PRIVATE USE_NETTLE=1) +- target_link_libraries(juice PRIVATE Nettle::Nettle) ++ target_link_libraries(juice PRIVATE ${NETTLE_LIBRARY_PATH}) + target_compile_definitions(juice-static PRIVATE USE_NETTLE=1) +- target_link_libraries(juice-static PRIVATE Nettle::Nettle) ++ target_link_libraries(juice-static PRIVATE ${NETTLE_LIBRARY_PATH}) + else() + target_compile_definitions(juice PRIVATE USE_NETTLE=0) + target_compile_definitions(juice-static PRIVATE USE_NETTLE=0) +@@ -137,8 +140,6 @@ endif() + + if(APPLE) + # This seems to be necessary on MacOS +- target_include_directories(juice PRIVATE /usr/local/include) +- target_include_directories(juice-static PRIVATE /usr/local/include) + endif() + + set_target_properties(juice PROPERTIES EXPORT_NAME LibJuice) +diff --git a/cmake/LibJuiceConfig.cmake.in b/cmake/LibJuiceConfig.cmake.in +index 247e53f..f049d9a 100644 +--- a/cmake/LibJuiceConfig.cmake.in ++++ b/cmake/LibJuiceConfig.cmake.in +@@ -1,4 +1,8 @@ + @PACKAGE_INIT@ + ++include(CMakeFindDependencyMacro) ++set(THREADS_PREFER_PTHREAD_FLAG ON) ++find_dependency(Threads) ++ + include("${CMAKE_CURRENT_LIST_DIR}/LibJuiceTargets.cmake") + diff --git a/vcpkg/ports/libjuice/portfile.cmake b/vcpkg/ports/libjuice/portfile.cmake new file mode 100644 index 0000000..3a6e274 --- /dev/null +++ b/vcpkg/ports/libjuice/portfile.cmake @@ -0,0 +1,33 @@ +vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO paullouisageneau/libjuice
+ REF "v${VERSION}"
+ SHA512 7364305b6768fdaef32cb7424c205e6dd11a3b8846ac52c8ce0cd66f022baae75f57293fefd2b9d80a89e3b138c82b4ef9b8b2313c2fb732db41947062ac2555
+ HEAD_REF master
+ PATCHES
+ dependencies.diff
+)
+
+vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
+ FEATURES
+ nettle USE_NETTLE
+)
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ OPTIONS
+ ${FEATURE_OPTIONS}
+ -DNO_TESTS=ON
+)
+
+vcpkg_cmake_install()
+vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/LibJuice)
+vcpkg_fixup_pkgconfig()
+
+if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
+ vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/juice/juice.h" "#ifndef JUICE_STATIC" "#if 0")
+endif()
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
+
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
diff --git a/vcpkg/ports/libjuice/vcpkg.json b/vcpkg/ports/libjuice/vcpkg.json new file mode 100644 index 0000000..b9efc31 --- /dev/null +++ b/vcpkg/ports/libjuice/vcpkg.json @@ -0,0 +1,25 @@ +{ + "name": "libjuice", + "version": "1.6.1", + "description": "The library is a simplified implementation of the Interactive Connectivity Establishment (ICE) protocol in C for POSIX platforms (including Linux and Apple macOS) and Microsoft Windows.", + "homepage": "https://github.com/paullouisageneau/libjuice", + "license": "LGPL-2.1-only", + "dependencies": [ + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ], + "features": { + "nettle": { + "description": "Use nettle for HMAC computation instead of the Builtin", + "dependencies": [ + "nettle" + ] + } + } +} |