diff --git a/ports/libdatachannel/library-linkage.diff b/ports/libdatachannel/library-linkage.diff index cf14cb4253..655c0320dc 100644 --- a/ports/libdatachannel/library-linkage.diff +++ b/ports/libdatachannel/library-linkage.diff @@ -1,8 +1,16 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index b35e4b1..1b5190b 100644 +index b35e4b1..b052d02 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -457,11 +457,17 @@ if(WARNINGS_AS_ERRORS) +@@ -48,7 +48,6 @@ endif() + + list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/Modules) + set(CMAKE_POSITION_INDEPENDENT_CODE ON) +-set(BUILD_SHARED_LIBS OFF) # to force usrsctp to be built static + + if(WIN32) + add_definitions(-DWIN32_LEAN_AND_MEAN) +@@ -457,11 +456,17 @@ if(WARNINGS_AS_ERRORS) endif() endif() diff --git a/ports/libdatachannel/portfile.cmake b/ports/libdatachannel/portfile.cmake index cb3345cb56..ab1db9c674 100644 --- a/ports/libdatachannel/portfile.cmake +++ b/ports/libdatachannel/portfile.cmake @@ -33,6 +33,7 @@ vcpkg_fixup_pkgconfig() if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/rtc/common.hpp" "#ifdef RTC_STATIC" "#if 1") + vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/rtc/rtc.h" "#ifdef RTC_STATIC" "#if 1") endif() file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" "${CURRENT_PACKAGES_DIR}/debug/share") diff --git a/ports/libdatachannel/vcpkg.json b/ports/libdatachannel/vcpkg.json index 32534d9fa5..71d55e0f4d 100644 --- a/ports/libdatachannel/vcpkg.json +++ b/ports/libdatachannel/vcpkg.json @@ -1,6 +1,7 @@ { "name": "libdatachannel", "version-semver": "0.21.2", + "port-version": 1, "description": "libdatachannel is a standalone implementation of WebRTC Data Channels, WebRTC Media Transport, and WebSockets in C++17 with C bindings for POSIX platforms (including GNU/Linux, Android, and Apple macOS) and Microsoft Windows.", "homepage": "https://github.com/paullouisageneau/libdatachannel", "license": "MPL-2.0", diff --git a/scripts/test_ports/vcpkg-ci-libdatachannel/cmake-project.diff b/scripts/test_ports/vcpkg-ci-libdatachannel/cmake-project.diff new file mode 100644 index 0000000000..2d2302f6cb --- /dev/null +++ b/scripts/test_ports/vcpkg-ci-libdatachannel/cmake-project.diff @@ -0,0 +1,29 @@ +diff --git a/examples/streamer/CMakeLists.txt b/examples/streamer/CMakeLists.txt +index 1bdeb7c..9cf65dd 100644 +--- a/examples/streamer/CMakeLists.txt ++++ b/examples/streamer/CMakeLists.txt +@@ -2,6 +2,15 @@ cmake_minimum_required(VERSION 3.7) + if(POLICY CMP0079) + cmake_policy(SET CMP0079 NEW) + endif() ++project(vcpkg-ci) ++add_definitions(-DWIN32_LEAN_AND_MEAN) ++set(THREADS_PREFER_PTHREAD_FLAG ON) ++find_package(Threads REQUIRED) ++find_package(nlohmann_json CONFIG REQUIRED) ++find_package(LibDataChannel CONFIG REQUIRED) ++if(NOT TARGET LibDataChannel::LibDataChannel) ++ add_library(LibDataChannel::LibDataChannel ALIAS LibDataChannel::LibDataChannelStatic) ++endif() + + set(STREAMER_SOURCES + main.cpp +@@ -47,7 +56,7 @@ set_target_properties(streamer PROPERTIES + find_package(Threads REQUIRED) + target_link_libraries(streamer LibDataChannel::LibDataChannel Threads::Threads nlohmann_json::nlohmann_json) + +-if(MSVC) ++if(0) + add_custom_command(TARGET streamer POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different + "$/datachannel.dll" diff --git a/scripts/test_ports/vcpkg-ci-libdatachannel/portfile.cmake b/scripts/test_ports/vcpkg-ci-libdatachannel/portfile.cmake new file mode 100644 index 0000000000..53ae55e0ec --- /dev/null +++ b/scripts/test_ports/vcpkg-ci-libdatachannel/portfile.cmake @@ -0,0 +1,14 @@ +set(VCPKG_POLICY_EMPTY_PACKAGE enabled) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO paullouisageneau/libdatachannel + REF v0.21.2 + SHA512 fd0d66bb932e29abc01e9f1a8b16ccb79012a7e3901e2e0f882f56ab2f090260945e1556c85ad07ef897b8c70fcdd44cdeead9955a9bca7afe1dda8900c473cc + HEAD_REF master + PATCHES + cmake-project.diff +) + +vcpkg_cmake_configure(SOURCE_PATH "${SOURCE_PATH}/examples/streamer") +vcpkg_cmake_build() diff --git a/scripts/test_ports/vcpkg-ci-libdatachannel/vcpkg.json b/scripts/test_ports/vcpkg-ci-libdatachannel/vcpkg.json new file mode 100644 index 0000000000..8d6056f530 --- /dev/null +++ b/scripts/test_ports/vcpkg-ci-libdatachannel/vcpkg.json @@ -0,0 +1,19 @@ +{ + "name": "vcpkg-ci-libdatachannel", + "version-string": "ci", + "description": "Validates libdatachannel", + "dependencies": [ + { + "name": "libdatachannel", + "features": [ + "srtp", + "ws" + ] + }, + "nlohmann-json", + { + "name": "vcpkg-cmake", + "host": true + } + ] +} diff --git a/versions/baseline.json b/versions/baseline.json index a10135a0d1..0ca4ed4c9f 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -4350,7 +4350,7 @@ }, "libdatachannel": { "baseline": "0.21.2", - "port-version": 0 + "port-version": 1 }, "libdatrie": { "baseline": "0.2.13", diff --git a/versions/l-/libdatachannel.json b/versions/l-/libdatachannel.json index cb5fd9f71e..7e27848a8f 100644 --- a/versions/l-/libdatachannel.json +++ b/versions/l-/libdatachannel.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "df0663ab881ed7a331bf51b6bf652e80fc55dbf4", + "version-semver": "0.21.2", + "port-version": 1 + }, { "git-tree": "7ef5c0cdf31856f7b73f1498dd8055627608801c", "version-semver": "0.21.2",