Skip to content

Commit 4bca7e2

Browse files
ptesavolSanttuRantanenjuslesangithub-actions[bot]
authored
Python and Go wrappers for libstreamrproxyclient shared library (#19)
* WebsocketServerTest unit tests added * work in progress * always wait for onConnected callback, no matter is the socket already open or not. OnOpen callback gets triggered when callback is set if the connection is already open * Create action_ios.yml ios install * Delete .github/workflows/reusable/cached-install/action_ios.yml * connectionamanager implemented * move to using templated CallContextType and move-by-value in RpcCommunicator * moved timout out of the callcontext * First ConnectionManager test passes * add EnableSharedFromThis and fix linting errors * add setting homebrew prefix in install and setenv scripts * add boost-endian dependency to streamr-utils * add waitforcondition(), improve naming * fix linting * potos of trackerless-network get built * waitForEvent and poller.start synchronized * waitForCondition unit tests added * waitForCondition unit tests added * developining.. * waitForCondition unit tests added * add ReplayEventEmitter that replays the latest event to new subscribers * Integration tests added * Websocket callbacks synchronized with mutexes * end-to-end test of ProxyClient compiles but does not work yet * submodule updated * fix outgoinghandshaker to save a copy of the targetpeerdescriptor * generate real random uuids, end-to end broadcast to ts goes through * use real random uuid * add utils for testing, split linting in parts * add errorCallback to send() of CommunicationManager * work-in-progress * split Endpoint to separate files, granularize mutex locking * upgrade vcpkg to latest version * end-to-end publishing test from libstreamrproxyclient shared library to ts server works * fix linting * update submodule * remove submodule * re-add submodule using https * change filename case in git * filename change case in include * change case to LibDataChannel * change include case * change include case * change to ubuntu-24.04 runner * change to noble apt repo * use gcc14 in github actions * fix case to LibDataChannel * fix case * improve github caching * include runner.arch in cache names * include runner.arch in cache names * remove experimental from folly include statements * remove unused includes * remove unused includes * re-introduce experimental * re-introduce experimental universally to all folly include statements * re-introduce experimental universally to all folly include statements * test also for gnuc in macro definition * remove size_t from c header file * add fPIC flag * set initial value for aborted to false in abortsignal * use custom main in utils tests * use initializer list when creating json * use custom test main in dht * change size_t argument to uint64_t in shared library * try fixing event after detroy in websocket * tests pass on linux * fix linting * fix linting * fix linting * add placeholder unit tests to fix linting * add more placeholder unit tests * remove cpptrace, add monorepo deps to libstreamrproxyclient * remove cpptrace to enable android builds * copy ios-aware homebrewClang.cmake to all directories * add more checks to ensure that setenvs.sh has been run * change case of utils.hpp * try fixing linting errors on linux * try fixing linting errors on linux * try fixing linting errors on linux * move to cland-18 on linux * move to cland-18 on linux * add missing include statements to fix linting * add missing include statements to fix linting * linting * linting * linting * linting * linting * force using clangd18 on linux * force using clangd18 on linux * force using clangd19 on linux * force using clangd19 on linux * add placeholder unit tests * try fixing linting errors on linux * try fixing linting errors on linux * try fixing linting errors on linux * linting * linting * sending multiple messages works * iOS xcframework and iOS LocationShare App (With static lib) added * Added mode *.o files to the static lib * Added one header file to the static lib * Android App added * Workaround removed from the Android app * Readme added to ios install * Readme added to android install * iOS unit test app added * Compiler flags added * README update * Dht unit tests added. Also IPendingConnection abstract class added in order to unit test using mocks * Unit tests added to iOS Unit Tester * Unit tests added to iOS Unit Tester * Unit tests added to CMakeLists.txt * Unit test removed from CMakeLists.txt * Unit test cleaned * convert streamrproxyclient.h to pure C * Fixed linting for DHT * Fixed linting for DHT * 3 flaky tests disabled * Unit tests fixed * 2 unit tests commented out. These must be checked later * Null check added and test disabled as flaky one * generate shared library distribusions automatically * also pack ios distribution to tgz * shared binary for arm64-osx * x64-osx build * add duration cast trying to fix a linux bug * added lfs * increase logging * linux binaries * temporary commit * rename utils.hpp to Utils.hpp * add readme to libstreamrproxyclient * update native-ts-integration submodule * update readme * add readme to the unix example * update readmes * Android App simplified (#18) * changed binaries * add signing utils * add binary utils * signing added to unix example * Signing added to Android LocationShare example app * Signing added to iOS LocationShare example app * Stream part Id changed * Stream part ID changed * add go and python examples * add initial cpp wrapper file * new c api compiles, tests fail * define copy, move and assignmet for ProxyResults and related classes * libstreamrproxyclient tests pass with the new C API * add python wrapper and fixes to the shared library * python wrapper works * go wrapper works * Module3 (#13) * fix linting * Integration tests added * capture list references changed to copies in notifyRemote * Old Exception type changed to string * server-side exceptions work * fix linting * fix linting * These generated files should be in git otherwise install does not work * Exception unit tests added for client and server * Exception wrapping added to notifyRemote. Also exception handling unit tests added to RpcCommunicatorTest * More integration tests added * timeouts work for calls * fix linting * fix linting * Unit tests cleaned * ServerRegistry unit tests cleaned * ProtoRpcTest integration tests cleaned * Linter modifications * minimal cleanup, tests working * clean up onIncomingMessage() * added client-side timeouts for notifications * protect mOngoingRequests with a mutex * rename outgoingMessageListener to outgoingMessageCallback * reduce logging levels * fix linting * add protobuf-generated files * fix linting in CI * increase CI caching * add example hello * add custom test main that calls folly::init * add custom test main that calls folly::init lint * improve CI caching * try fixing tests * Part of RoutesHello example added * add example routedhello * add readme * try making notifytask a member function * try making notifytask a member function * remove task-creating labda * lint * use own executors * increase logging * debugging * use cpu executor directly instead of through a task * lint * move callback by value * add folly example * Reference removed in capture list * Typo fixed * fix linting * add overlay triplet for x64 linux to compile folly in release mode only * added temporary overlay port for magic-enum to fix changed hash * split RpcCommunicator into three parts * add comments and clean up * add permalinks to protobuf files pointing to github commits of network-monorepo * rename callRemote() and notifyRemote() to request() and notify() * iOS overlaytriplet added * only install dependencies once in monorepo * simplify install action of github * lint * vcpkg install --triplet=arm64-ios works * add support for --ios and --android flags in install.sh * rename flag iphone to ios * developing install.sh for iphone * continue developing install.sh for iphone * add checks to install.sh to prevent running with false settings * simple ios framework dylib builds * ./install.sh --ios works in project root * dynamic ios example works * add Branded<> utility type * move to using std::string_view in Logger APIs * websockets work * update vcpkg * compiles on osx clang 18 * ios compiles with clang 18 * android build works * revert to clang17 on mac/ios because exceptions cannot be caught on clang18 because of incompatibility with c++abi * Fix for segmentation fault. And some unit tests which should be modified later when exception handling is added. * add adnroidttest.sh to run tests on android through adb (a device or an emulator must be connected) * WebsocketServerTest unit tests added * work in progress * always wait for onConnected callback, no matter is the socket already open or not. OnOpen callback gets triggered when callback is set if the connection is already open * connectionamanager implemented * move to using templated CallContextType and move-by-value in RpcCommunicator * moved timout out of the callcontext * First ConnectionManager test passes * add EnableSharedFromThis and fix linting errors * add setting homebrew prefix in install and setenv scripts * add boost-endian dependency to streamr-utils * add waitforcondition(), improve naming * fix linting * potos of trackerless-network get built * waitForEvent and poller.start synchronized * waitForCondition unit tests added * waitForCondition unit tests added * developining.. * waitForCondition unit tests added * add ReplayEventEmitter that replays the latest event to new subscribers * Integration tests added * Websocket callbacks synchronized with mutexes * end-to-end test of ProxyClient compiles but does not work yet * submodule updated * fix outgoinghandshaker to save a copy of the targetpeerdescriptor * generate real random uuids, end-to end broadcast to ts goes through * use real random uuid * add utils for testing, split linting in parts * add errorCallback to send() of CommunicationManager * work-in-progress * split Endpoint to separate files, granularize mutex locking * upgrade vcpkg to latest version * end-to-end publishing test from libstreamrproxyclient shared library to ts server works * fix linting * update submodule * remove submodule * re-add submodule using https * change filename case in git * filename change case in include * change case to LibDataChannel * change include case * change include case * change to ubuntu-24.04 runner * change to noble apt repo * use gcc14 in github actions * fix case to LibDataChannel * fix case * improve github caching * include runner.arch in cache names * include runner.arch in cache names * remove experimental from folly include statements * remove unused includes * remove unused includes * re-introduce experimental * re-introduce experimental universally to all folly include statements * re-introduce experimental universally to all folly include statements * test also for gnuc in macro definition * remove size_t from c header file * add fPIC flag * set initial value for aborted to false in abortsignal * use custom main in utils tests * use initializer list when creating json * use custom test main in dht * change size_t argument to uint64_t in shared library * try fixing event after detroy in websocket * tests pass on linux * fix linting * fix linting * fix linting * add placeholder unit tests to fix linting * add more placeholder unit tests * remove cpptrace, add monorepo deps to libstreamrproxyclient * remove cpptrace to enable android builds * copy ios-aware homebrewClang.cmake to all directories * add more checks to ensure that setenvs.sh has been run * change case of utils.hpp * try fixing linting errors on linux * try fixing linting errors on linux * try fixing linting errors on linux * move to cland-18 on linux * move to cland-18 on linux * add missing include statements to fix linting * add missing include statements to fix linting * linting * linting * linting * linting * linting * force using clangd18 on linux * force using clangd18 on linux * force using clangd19 on linux * force using clangd19 on linux * add placeholder unit tests * try fixing linting errors on linux * try fixing linting errors on linux * try fixing linting errors on linux * linting * linting * sending multiple messages works * iOS xcframework and iOS LocationShare App (With static lib) added * Added mode *.o files to the static lib * Added one header file to the static lib * Android App added * Workaround removed from the Android app * Readme added to ios install * Readme added to android install * iOS unit test app added * Compiler flags added * README update * Dht unit tests added. Also IPendingConnection abstract class added in order to unit test using mocks * Unit tests added to iOS Unit Tester * Unit tests added to iOS Unit Tester * Unit tests added to CMakeLists.txt * Unit test removed from CMakeLists.txt * Unit test cleaned * convert streamrproxyclient.h to pure C * Fixed linting for DHT * Fixed linting for DHT * 3 flaky tests disabled * Unit tests fixed * 2 unit tests commented out. These must be checked later * Null check added and test disabled as flaky one * generate shared library distribusions automatically * also pack ios distribution to tgz * shared binary for arm64-osx * x64-osx build * add duration cast trying to fix a linux bug * added lfs * increase logging * linux binaries * temporary commit * rename utils.hpp to Utils.hpp * add readme to libstreamrproxyclient * update native-ts-integration submodule * update readme * add readme to the unix example * update readmes * Android App simplified (#18) * changed binaries * add signing utils * add binary utils * signing added to unix example * Signing added to Android LocationShare example app * Signing added to iOS LocationShare example app * Stream part Id changed * Stream part ID changed * add go and python examples * try changing clangd to v 17 to fix linting * try another version of clang-format to fi linting * try to get lint working in ci * change to clang-format 18 * lint fixes * add on more placeholder test * more placeholders * more placeholders * fix json test nullptr handling * fix tests * add one more placeholder test * disable WebSocketServer tests that read certs from disk to make them work in CI --------- Co-authored-by: Santtu <santtu.rantanen@gmail.com> Co-authored-by: juslesan <santeri.juslenius@gmail.com> * fix lint * lint fix * lint fixes * try autogenerating and auto-committing binaries * fix bug in workflow * removed dist to fix lfs * add cmake install to libstreamrproxyclient * remove go dist from gitignore * remove go dist from gitignore * try fixing detached head in CI action push * try get lfs to work in ci * lfs push * lfs push * ... * . * allow incomplete push * add README.md * linux binaries * Module3 (#13) * fix linting * Integration tests added * capture list references changed to copies in notifyRemote * Old Exception type changed to string * server-side exceptions work * fix linting * fix linting * These generated files should be in git otherwise install does not work * Exception unit tests added for client and server * Exception wrapping added to notifyRemote. Also exception handling unit tests added to RpcCommunicatorTest * More integration tests added * timeouts work for calls * fix linting * fix linting * Unit tests cleaned * ServerRegistry unit tests cleaned * ProtoRpcTest integration tests cleaned * Linter modifications * minimal cleanup, tests working * clean up onIncomingMessage() * added client-side timeouts for notifications * protect mOngoingRequests with a mutex * rename outgoingMessageListener to outgoingMessageCallback * reduce logging levels * fix linting * add protobuf-generated files * fix linting in CI * increase CI caching * add example hello * add custom test main that calls folly::init * add custom test main that calls folly::init lint * improve CI caching * try fixing tests * Part of RoutesHello example added * add example routedhello * add readme * try making notifytask a member function * try making notifytask a member function * remove task-creating labda * lint * use own executors * increase logging * debugging * use cpu executor directly instead of through a task * lint * move callback by value * add folly example * Reference removed in capture list * Typo fixed * fix linting * add overlay triplet for x64 linux to compile folly in release mode only * added temporary overlay port for magic-enum to fix changed hash * split RpcCommunicator into three parts * add comments and clean up * add permalinks to protobuf files pointing to github commits of network-monorepo * rename callRemote() and notifyRemote() to request() and notify() * iOS overlaytriplet added * only install dependencies once in monorepo * simplify install action of github * lint * vcpkg install --triplet=arm64-ios works * add support for --ios and --android flags in install.sh * rename flag iphone to ios * developing install.sh for iphone * continue developing install.sh for iphone * add checks to install.sh to prevent running with false settings * simple ios framework dylib builds * ./install.sh --ios works in project root * dynamic ios example works * add Branded<> utility type * move to using std::string_view in Logger APIs * websockets work * update vcpkg * compiles on osx clang 18 * ios compiles with clang 18 * android build works * revert to clang17 on mac/ios because exceptions cannot be caught on clang18 because of incompatibility with c++abi * Fix for segmentation fault. And some unit tests which should be modified later when exception handling is added. * add adnroidttest.sh to run tests on android through adb (a device or an emulator must be connected) * WebsocketServerTest unit tests added * work in progress * always wait for onConnected callback, no matter is the socket already open or not. OnOpen callback gets triggered when callback is set if the connection is already open * connectionamanager implemented * move to using templated CallContextType and move-by-value in RpcCommunicator * moved timout out of the callcontext * First ConnectionManager test passes * add EnableSharedFromThis and fix linting errors * add setting homebrew prefix in install and setenv scripts * add boost-endian dependency to streamr-utils * add waitforcondition(), improve naming * fix linting * potos of trackerless-network get built * waitForEvent and poller.start synchronized * waitForCondition unit tests added * waitForCondition unit tests added * developining.. * waitForCondition unit tests added * add ReplayEventEmitter that replays the latest event to new subscribers * Integration tests added * Websocket callbacks synchronized with mutexes * end-to-end test of ProxyClient compiles but does not work yet * submodule updated * fix outgoinghandshaker to save a copy of the targetpeerdescriptor * generate real random uuids, end-to end broadcast to ts goes through * use real random uuid * add utils for testing, split linting in parts * add errorCallback to send() of CommunicationManager * work-in-progress * split Endpoint to separate files, granularize mutex locking * upgrade vcpkg to latest version * end-to-end publishing test from libstreamrproxyclient shared library to ts server works * fix linting * update submodule * remove submodule * re-add submodule using https * change filename case in git * filename change case in include * change case to LibDataChannel * change include case * change include case * change to ubuntu-24.04 runner * change to noble apt repo * use gcc14 in github actions * fix case to LibDataChannel * fix case * improve github caching * include runner.arch in cache names * include runner.arch in cache names * remove experimental from folly include statements * remove unused includes * remove unused includes * re-introduce experimental * re-introduce experimental universally to all folly include statements * re-introduce experimental universally to all folly include statements * test also for gnuc in macro definition * remove size_t from c header file * add fPIC flag * set initial value for aborted to false in abortsignal * use custom main in utils tests * use initializer list when creating json * use custom test main in dht * change size_t argument to uint64_t in shared library * try fixing event after detroy in websocket * tests pass on linux * fix linting * fix linting * fix linting * add placeholder unit tests to fix linting * add more placeholder unit tests * remove cpptrace, add monorepo deps to libstreamrproxyclient * remove cpptrace to enable android builds * copy ios-aware homebrewClang.cmake to all directories * add more checks to ensure that setenvs.sh has been run * change case of utils.hpp * try fixing linting errors on linux * try fixing linting errors on linux * try fixing linting errors on linux * move to cland-18 on linux * move to cland-18 on linux * add missing include statements to fix linting * add missing include statements to fix linting * linting * linting * linting * linting * linting * force using clangd18 on linux * force using clangd18 on linux * force using clangd19 on linux * force using clangd19 on linux * add placeholder unit tests * try fixing linting errors on linux * try fixing linting errors on linux * try fixing linting errors on linux * linting * linting * sending multiple messages works * iOS xcframework and iOS LocationShare App (With static lib) added * Added mode *.o files to the static lib * Added one header file to the static lib * Android App added * Workaround removed from the Android app * Readme added to ios install * Readme added to android install * iOS unit test app added * Compiler flags added * README update * Dht unit tests added. Also IPendingConnection abstract class added in order to unit test using mocks * Unit tests added to iOS Unit Tester * Unit tests added to iOS Unit Tester * Unit tests added to CMakeLists.txt * Unit test removed from CMakeLists.txt * Unit test cleaned * convert streamrproxyclient.h to pure C * Fixed linting for DHT * Fixed linting for DHT * 3 flaky tests disabled * Unit tests fixed * 2 unit tests commented out. These must be checked later * Null check added and test disabled as flaky one * generate shared library distribusions automatically * also pack ios distribution to tgz * shared binary for arm64-osx * x64-osx build * add duration cast trying to fix a linux bug * added lfs * increase logging * linux binaries * temporary commit * rename utils.hpp to Utils.hpp * add readme to libstreamrproxyclient * update native-ts-integration submodule * update readme * add readme to the unix example * update readmes * Android App simplified (#18) * changed binaries * add signing utils * add binary utils * signing added to unix example * Signing added to Android LocationShare example app * Signing added to iOS LocationShare example app * Stream part Id changed * Stream part ID changed * add go and python examples * try changing clangd to v 17 to fix linting * try another version of clang-format to fi linting * try to get lint working in ci * change to clang-format 18 * lint fixes * add on more placeholder test * more placeholders * more placeholders * fix json test nullptr handling * fix tests * add one more placeholder test * disable WebSocketServer tests that read certs from disk to make them work in CI --------- Co-authored-by: Santtu <santtu.rantanen@gmail.com> Co-authored-by: juslesan <santeri.juslenius@gmail.com> * add missing lfs files * remove lfs from actions * remove lfs files * rm * Update action.yml * fix formatting * remove gitattributes * Automatically compiled binaries * try running ci on macos * try ignoring xcode install failure * try ignoring llvm install failure * try ignoring more install failures * try different macos versions * exclude PluginCodeGenerator.hpp from linting * add arm-64 linux runner to matrix * Automatically compiled binaries * pull before push in git scripts * Automatically compiled binaries * change git command to rebase * Automatically compiled binaries * Automatically compiled binaries * fix tests * Automatically compiled binaries * Automatically compiled binaries * debug tests on mac runner * cat libdatachannel build log on build failure * Automatically compiled binaries * use unique ports in tests * Automatically compiled binaries * enable all 4 matrix builds * Automatically compiled binaries * fix tests * Automatically compiled binaries * Automatically compiled binaries * Automatically compiled binaries * Automatically compiled binaries * increase test timeout * restart all jobs * Automatically compiled binaries * Automatically compiled binaries * Automatically compiled binaries * Automatically compiled binaries * Automatically compiled binaries * add go example * remove gowrapper, make it a submodule later * add gowrapper as submodule * prepare for merge * improve go example * add script for creating python package, add readme to go and python wrappers * add c++ wrapper * lint * fix folly to work with latest android studio * fix remainin conflicts * try python publishing in CI * add submodule support to CI * try fixing folly * re-run jobs * patch libdatachannel * set c compiler envs * try using file copy * try using file copy and rename * remove unnecessary env vars from install.sh * do not push binaries to repo * remove second cpp wrapper * fix createpythonpackage --------- Co-authored-by: Santtu <santtu.rantanen@gmail.com> Co-authored-by: juslesan <santeri.juslenius@gmail.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent ce8c42c commit 4bca7e2

79 files changed

Lines changed: 1286 additions & 2159 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/reusable/cached-install/action.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,14 @@ runs:
6363
key: ${{ runner.arch }}-${{ runner.os }}-cache-vcpkg-installed1-${{ hashFiles('./vcpkg.json') }}
6464
path: |
6565
./build/vcpkg_installed
66+
#- name: Commit compiled binaries
67+
# run: |
68+
# git config --global user.name 'github-actions[bot]'
69+
# git config --global user.email 'github-actions[bot]@users.noreply.github.com'
70+
# git add packages/streamr-libstreamrproxyclient/dist
71+
# git add packages/streamr-libstreamrproxyclient/wrappers/go
72+
# git commit -m "Automatically compiled binaries"
73+
# git pull --rebase --no-edit
74+
# git push --no-verify
75+
# shell: bash
6676

.github/workflows/validate.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ jobs:
2727
with:
2828
ref: ${{ github.event.pull_request.head.ref }}
2929
fetch-depth: 0
30+
submodules: true
31+
token: ${{ secrets.GITHUB_TOKEN }}
3032
- name: install
3133
uses: ./.github/workflows/reusable/cached-install
3234
- name: lint

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,6 @@
99
[submodule "packages/streamr-trackerless-network/test/integration/ts-integration"]
1010
path = packages/streamr-trackerless-network/test/integration/ts-integration
1111
url = https://github.com/streamr-dev/native-ts-integration.git
12+
[submodule "packages/streamr-libstreamrproxyclient/wrappers/go"]
13+
path = packages/streamr-libstreamrproxyclient/wrappers/go
14+
url = git@github.com:streamr-dev/goproxyclient.git

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@ message(STATUS "Root project VCPKG_TARGET_TRIPLET: ${VCPKG_TARGET_TRIPLET}")
2121
foreach(package ${MonorepoPackages})
2222
add_subdirectory(packages/${package})
2323
endforeach()
24+
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/folly/io/Cursor.h b/folly/io/Cursor.h
2+
index 7a0abc9..710ba3e 100644
3+
--- a/folly/io/Cursor.h
4+
+++ b/folly/io/Cursor.h
5+
@@ -683,7 +683,7 @@ class CursorBase {
6+
*
7+
* @methodset Accessors
8+
*/
9+
- std::basic_string_view<uint8_t> peekView() {
10+
+ std::basic_string_view<char> peekView() {
11+
auto bytes = peekBytes();
12+
return {bytes.data(), bytes.size()};
13+
}

overlayports/folly/fix-range.patch

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/folly/Range.h b/folly/Range.h
2+
index 42cd92d69..d87914a99 100644
3+
--- a/folly/Range.h
4+
+++ b/folly/Range.h
5+
@@ -638,7 +638,7 @@ class Range {
6+
template <typename ValueType>
7+
struct StringViewType //
8+
: std::conditional<
9+
- std::is_trivial<ValueType>::value,
10+
+ detail::range_is_char_type_v_<Iter>,
11+
std::basic_string_view<ValueType>,
12+
NotStringView> {};
13+

overlayports/folly/portfile.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ vcpkg_from_github(
2121
disable-groupvarint.patch
2222
disable-cxa-init-primary-exception.patch
2323
fix-android-remainder.patch
24+
fix-range.patch
25+
fix-cursor.patch
2426
)
2527

2628
file(REMOVE "${SOURCE_PATH}/CMake/FindFmt.cmake")
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
diff --git a/CMakeLists.txt b/CMakeLists.txt
2+
index 8a61757..b35e4b1 100644
3+
--- a/CMakeLists.txt
4+
+++ b/CMakeLists.txt
5+
@@ -234,7 +234,7 @@ set(THREADS_PREFER_PTHREAD_FLAG TRUE)
6+
find_package(Threads REQUIRED)
7+
8+
if(USE_SYSTEM_PLOG)
9+
- find_package(plog REQUIRED)
10+
+ find_package(plog CONFIG REQUIRED)
11+
else()
12+
set(CMAKE_POLICY_DEFAULT_CMP0048 NEW)
13+
add_subdirectory(deps/plog EXCLUDE_FROM_ALL)
14+
@@ -245,7 +245,8 @@ if(SCTP_DEBUG)
15+
endif()
16+
17+
if(USE_SYSTEM_USRSCTP)
18+
- find_package(Usrsctp REQUIRED)
19+
+ find_package(unofficial-usrsctp CONFIG REQUIRED)
20+
+ add_library(Usrsctp::Usrsctp ALIAS unofficial::usrsctp::usrsctp)
21+
else()
22+
option(sctp_build_shared_lib OFF)
23+
option(sctp_build_programs OFF)
24+
@@ -331,7 +332,7 @@ else()
25+
target_compile_definitions(datachannel PUBLIC RTC_ENABLE_MEDIA=1)
26+
target_compile_definitions(datachannel-static PUBLIC RTC_ENABLE_MEDIA=1)
27+
if(USE_SYSTEM_SRTP)
28+
- find_package(libSRTP REQUIRED)
29+
+ find_package(libSRTP CONFIG REQUIRED)
30+
if(NOT TARGET libSRTP::srtp2)
31+
add_library(libSRTP::srtp2 UNKNOWN IMPORTED)
32+
set_target_properties(libSRTP::srtp2 PROPERTIES
33+
@@ -475,8 +476,9 @@ install(
34+
)
35+
36+
# Export config
37+
+configure_file(cmake/LibDataChannelConfig.cmake ${CMAKE_CURRENT_BINARY_DIR}/cmake/LibDataChannelConfig.cmake @ONLY)
38+
install(
39+
- FILES ${CMAKE_CURRENT_SOURCE_DIR}/cmake/LibDataChannelConfig.cmake
40+
+ FILES ${CMAKE_CURRENT_BINARY_DIR}/cmake/LibDataChannelConfig.cmake
41+
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/LibDataChannel
42+
)
43+
44+
diff --git a/cmake/LibDataChannelConfig.cmake b/cmake/LibDataChannelConfig.cmake
45+
index cb2b884..d0b77ca 100644
46+
--- a/cmake/LibDataChannelConfig.cmake
47+
+++ b/cmake/LibDataChannelConfig.cmake
48+
@@ -1,2 +1,15 @@
49+
+if(NOT "@BUILD_SHARED_LIBS@")
50+
+ include(CMakeFindDependencyMacro)
51+
+ set(THREADS_PREFER_PTHREAD_FLAG ON)
52+
+ find_dependency(Threads)
53+
+ find_dependency(plog CONFIG)
54+
+ find_dependency(unofficial-usrsctp CONFIG)
55+
+ if(NOT "@NO_MEDIA@")
56+
+ find_dependency(libSRTP CONFIG)
57+
+ endif()
58+
+ find_dependency(OpenSSL)
59+
+ find_dependency(LibJuice)
60+
+endif()
61+
+
62+
include("${CMAKE_CURRENT_LIST_DIR}/LibDataChannelTargets.cmake")
63+
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
diff --git a/CMakeLists.txt b/CMakeLists.txt
2+
index 38e069e..0ada768 100644
3+
--- a/CMakeLists.txt
4+
+++ b/CMakeLists.txt
5+
@@ -260,10 +260,20 @@ else()
6+
add_library(Usrsctp::Usrsctp ALIAS usrsctp)
7+
endif()
8+
9+
-configure_file (
10+
- ${PROJECT_SOURCE_DIR}/cmake/version.h.in
11+
- ${CMAKE_CURRENT_SOURCE_DIR}/include/rtc/version.h
12+
+if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/include/rtc/version.h")
13+
+ file(REMOVE "${CMAKE_CURRENT_SOURCE_DIR}/include/rtc/version.h")
14+
+endif()
15+
+
16+
+file(COPY
17+
+ ${CMAKE_CURRENT_SOURCE_DIR}/cmake/version.h.in
18+
+ DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/include/rtc
19+
)
20+
+file(RENAME
21+
+ ${CMAKE_CURRENT_SOURCE_DIR}/include/rtc/version.h.in
22+
+ ${CMAKE_CURRENT_SOURCE_DIR}/include/rtc/version.h
23+
+)
24+
+
25+
+
26+
27+
add_library(datachannel SHARED
28+
${LIBDATACHANNEL_SOURCES}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
diff --git a/CMakeLists.txt b/CMakeLists.txt
2+
index b35e4b1..b052d02 100644
3+
--- a/CMakeLists.txt
4+
+++ b/CMakeLists.txt
5+
@@ -48,7 +48,6 @@ endif()
6+
7+
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/Modules)
8+
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
9+
-set(BUILD_SHARED_LIBS OFF) # to force usrsctp to be built static
10+
11+
if(WIN32)
12+
add_definitions(-DWIN32_LEAN_AND_MEAN)
13+
@@ -457,11 +456,17 @@ if(WARNINGS_AS_ERRORS)
14+
endif()
15+
endif()
16+
17+
+if(BUILD_SHARED_LIBS)
18+
install(TARGETS datachannel EXPORT LibDataChannelTargets
19+
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
20+
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
21+
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
22+
)
23+
+else()
24+
+ set_target_properties(datachannel PROPERTIES EXCLUDE_FROM_ALL 1)
25+
+ set_target_properties(datachannel-static PROPERTIES EXCLUDE_FROM_ALL 0)
26+
+ install(TARGETS datachannel-static EXPORT LibDataChannelTargets)
27+
+endif()
28+
29+
install(FILES ${LIBDATACHANNEL_HEADERS}
30+
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/rtc

0 commit comments

Comments
 (0)