Add webrtc-sys pacakge, build webrtc through cargo
This commit is contained in:
parent
80b67db60d
commit
bfc42fdaee
2
.cargo/config.toml
Normal file
2
.cargo/config.toml
Normal file
@ -0,0 +1,2 @@
|
||||
[env]
|
||||
CARGO_WORKSPACE_DIR = { value = "", relative = true }
|
||||
4
.gitignore
vendored
4
.gitignore
vendored
@ -3,7 +3,6 @@ out-arm/
|
||||
cscope.*
|
||||
.DS_Store
|
||||
.dir-locals.el
|
||||
.cargo
|
||||
.gradle/
|
||||
*.code-workspace
|
||||
**/.vscode
|
||||
@ -15,6 +14,7 @@ src/jar.list
|
||||
org.eclipse.buildship.core.prefs
|
||||
local.properties
|
||||
*.tar.gz
|
||||
.cargo
|
||||
.cargo/*
|
||||
!.cargo/config.toml
|
||||
target
|
||||
.spr.yml
|
||||
|
||||
683
Cargo.lock
generated
683
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@ -10,6 +10,8 @@ members = [
|
||||
"mrp",
|
||||
"protobuf",
|
||||
"src/rust",
|
||||
"webrtc-sys",
|
||||
"webrtc-sys/build",
|
||||
]
|
||||
|
||||
[workspace.package]
|
||||
|
||||
@ -10,6 +10,7 @@ accepted = [
|
||||
"AGPL-3.0-only",
|
||||
"ISC",
|
||||
"Unicode-3.0",
|
||||
"Zlib",
|
||||
]
|
||||
|
||||
ignore-dev-dependencies = true
|
||||
|
||||
@ -45,13 +45,14 @@
|
||||
|
||||
<h2>Overview of licenses:</h2>
|
||||
<ul class="licenses-overview">
|
||||
<li><a href="#MIT">MIT License</a> (184)</li>
|
||||
<li><a href="#MIT">MIT License</a> (185)</li>
|
||||
<li><a href="#Apache-2.0">Apache License 2.0</a> (13)</li>
|
||||
<li><a href="#AGPL-3.0-only">GNU Affero General Public License v3.0 only</a> (12)</li>
|
||||
<li><a href="#BSD-3-Clause">BSD 3-Clause "New" or "Revised" License</a> (4)</li>
|
||||
<li><a href="#ISC">ISC License</a> (4)</li>
|
||||
<li><a href="#MPL-2.0">Mozilla Public License 2.0</a> (2)</li>
|
||||
<li><a href="#Unicode-3.0">Unicode License v3</a> (1)</li>
|
||||
<li><a href="#Zlib">zlib License</a> (1)</li>
|
||||
</ul>
|
||||
|
||||
<h2>All license text:</h2>
|
||||
@ -982,7 +983,7 @@ You should also get your employer (if you work as a programmer) or school, if an
|
||||
<h3 id="Apache-2.0">Apache License 2.0</h3>
|
||||
<h4>Used by:</h4>
|
||||
<ul class="license-used-by">
|
||||
<li><a href="https://github.com/Byron/pulldown-cmark-to-cmark">pulldown-cmark-to-cmark 21.1.0</a></li>
|
||||
<li><a href="https://github.com/Byron/pulldown-cmark-to-cmark">pulldown-cmark-to-cmark 22.0.0</a></li>
|
||||
</ul>
|
||||
<pre class="license-text"> Apache License
|
||||
Version 2.0, January 2004
|
||||
@ -1400,10 +1401,10 @@ You should also get your employer (if you work as a programmer) or school, if an
|
||||
<h3 id="Apache-2.0">Apache License 2.0</h3>
|
||||
<h4>Used by:</h4>
|
||||
<ul class="license-used-by">
|
||||
<li><a href="https://github.com/tokio-rs/prost">prost-build 0.14.1</a></li>
|
||||
<li><a href="https://github.com/tokio-rs/prost">prost-derive 0.14.1</a></li>
|
||||
<li><a href="https://github.com/tokio-rs/prost">prost-types 0.14.1</a></li>
|
||||
<li><a href="https://github.com/tokio-rs/prost">prost 0.14.1</a></li>
|
||||
<li><a href="https://github.com/tokio-rs/prost">prost-build 0.14.3</a></li>
|
||||
<li><a href="https://github.com/tokio-rs/prost">prost-derive 0.14.3</a></li>
|
||||
<li><a href="https://github.com/tokio-rs/prost">prost-types 0.14.3</a></li>
|
||||
<li><a href="https://github.com/tokio-rs/prost">prost 0.14.3</a></li>
|
||||
</ul>
|
||||
<pre class="license-text"> Apache License
|
||||
Version 2.0, January 2004
|
||||
@ -2023,10 +2024,10 @@ SOFTWARE.
|
||||
<h3 id="MIT">MIT License</h3>
|
||||
<h4>Used by:</h4>
|
||||
<ul class="license-used-by">
|
||||
<li><a href="https://github.com/rust-lang/cc-rs">cc 1.2.51</a></li>
|
||||
<li><a href="https://github.com/rust-lang/cc-rs">cc 1.2.54</a></li>
|
||||
<li><a href="https://github.com/rust-lang/cfg-if">cfg-if 1.0.4</a></li>
|
||||
<li><a href="https://github.com/rust-lang/cmake-rs">cmake 0.1.57</a></li>
|
||||
<li><a href="https://github.com/rust-lang/cc-rs">find-msvc-tools 0.1.6</a></li>
|
||||
<li><a href="https://github.com/rust-lang/cc-rs">find-msvc-tools 0.1.8</a></li>
|
||||
<li><a href="https://github.com/rust-lang/pkg-config-rs">pkg-config 0.3.32</a></li>
|
||||
</ul>
|
||||
<pre class="license-text">Copyright (c) 2014 Alex Crichton
|
||||
@ -2093,7 +2094,7 @@ DEALINGS IN THE SOFTWARE.
|
||||
<h3 id="MIT">MIT License</h3>
|
||||
<h4>Used by:</h4>
|
||||
<ul class="license-used-by">
|
||||
<li><a href="https://github.com/RustCrypto/formats">base64ct 1.8.2</a></li>
|
||||
<li><a href="https://github.com/RustCrypto/formats">base64ct 1.8.3</a></li>
|
||||
</ul>
|
||||
<pre class="license-text">Copyright (c) 2014 Steve "Sc00bz" Thomas (steve at tobtu dot com)
|
||||
Copyright (c) 2021-2025 The RustCrypto Project Developers
|
||||
@ -2165,7 +2166,7 @@ DEALINGS IN THE SOFTWARE.
|
||||
<h3 id="MIT">MIT License</h3>
|
||||
<h4>Used by:</h4>
|
||||
<ul class="license-used-by">
|
||||
<li><a href="https://github.com/uuid-rs/uuid">uuid 1.19.0</a></li>
|
||||
<li><a href="https://github.com/uuid-rs/uuid">uuid 1.20.0</a></li>
|
||||
</ul>
|
||||
<pre class="license-text">Copyright (c) 2014 The Rust Project Developers
|
||||
Copyright (c) 2018 Ashley Mannix, Christopher Armstrong, Dylan DPC, Hunar Roop Kahlon
|
||||
@ -2199,7 +2200,7 @@ DEALINGS IN THE SOFTWARE.
|
||||
<h3 id="MIT">MIT License</h3>
|
||||
<h4>Used by:</h4>
|
||||
<ul class="license-used-by">
|
||||
<li><a href="https://github.com/rust-lang/libc">libc 0.2.179</a></li>
|
||||
<li><a href="https://github.com/rust-lang/libc">libc 0.2.180</a></li>
|
||||
</ul>
|
||||
<pre class="license-text">Copyright (c) 2014-2020 The Rust Project Developers
|
||||
|
||||
@ -2262,7 +2263,7 @@ THE SOFTWARE.
|
||||
<ul class="license-used-by">
|
||||
<li><a href="https://github.com/rayon-rs/either">either 1.15.0</a></li>
|
||||
<li><a href="https://github.com/rust-itertools/itertools">itertools 0.14.0</a></li>
|
||||
<li><a href="https://github.com/petgraph/petgraph">petgraph 0.7.1</a></li>
|
||||
<li><a href="https://github.com/petgraph/petgraph">petgraph 0.8.3</a></li>
|
||||
<li><a href="https://github.com/jonasbb/serde_with/">serde_with 3.16.1</a></li>
|
||||
<li><a href="https://github.com/jonasbb/serde_with/">serde_with_macros 3.16.1</a></li>
|
||||
</ul>
|
||||
@ -2572,6 +2573,7 @@ DEALINGS IN THE SOFTWARE.
|
||||
<h3 id="MIT">MIT License</h3>
|
||||
<h4>Used by:</h4>
|
||||
<ul class="license-used-by">
|
||||
<li><a href="https://github.com/rust-lang/hashbrown">hashbrown 0.15.5</a></li>
|
||||
<li><a href="https://github.com/rust-lang/hashbrown">hashbrown 0.16.1</a></li>
|
||||
</ul>
|
||||
<pre class="license-text">Copyright (c) 2016 Amanieu d'Antras
|
||||
@ -3038,7 +3040,7 @@ DEALINGS IN THE SOFTWARE.
|
||||
<h3 id="MIT">MIT License</h3>
|
||||
<h4>Used by:</h4>
|
||||
<ul class="license-used-by">
|
||||
<li><a href="https://github.com/rust-random/getrandom">getrandom 0.2.16</a></li>
|
||||
<li><a href="https://github.com/rust-random/getrandom">getrandom 0.2.17</a></li>
|
||||
</ul>
|
||||
<pre class="license-text">Copyright (c) 2018-2024 The rust-random Project Developers
|
||||
Copyright (c) 2014 The Rust Project Developers
|
||||
@ -3561,7 +3563,7 @@ SOFTWARE.
|
||||
<li><a href="https://github.com/rust-random/rand">rand_chacha 0.3.1</a></li>
|
||||
<li><a href="https://github.com/rust-random/rand">rand_chacha 0.9.0</a></li>
|
||||
<li><a href="https://github.com/rust-random/rand">rand_core 0.6.4</a></li>
|
||||
<li><a href="https://github.com/rust-random/rand">rand_core 0.9.3</a></li>
|
||||
<li><a href="https://github.com/rust-random/rand">rand_core 0.9.5</a></li>
|
||||
</ul>
|
||||
<pre class="license-text">Copyright 2018 Developers of the Rand project
|
||||
Copyright (c) 2014 The Rust Project Developers
|
||||
@ -3595,8 +3597,8 @@ DEALINGS IN THE SOFTWARE.
|
||||
<h3 id="MIT">MIT License</h3>
|
||||
<h4>Used by:</h4>
|
||||
<ul class="license-used-by">
|
||||
<li><a href="https://github.com/google/zerocopy">zerocopy-derive 0.8.33</a></li>
|
||||
<li><a href="https://github.com/google/zerocopy">zerocopy 0.8.33</a></li>
|
||||
<li><a href="https://github.com/google/zerocopy">zerocopy-derive 0.8.34</a></li>
|
||||
<li><a href="https://github.com/google/zerocopy">zerocopy 0.8.34</a></li>
|
||||
</ul>
|
||||
<pre class="license-text">Copyright 2023 The Fuchsia Authors
|
||||
|
||||
@ -3929,8 +3931,8 @@ SOFTWARE.
|
||||
<li><a href="https://github.com/matklad/once_cell">once_cell 1.21.3</a></li>
|
||||
<li><a href="https://github.com/dtolnay/prettyplease">prettyplease 0.2.37</a></li>
|
||||
<li><a href="https://github.com/bkchr/proc-macro-crate">proc-macro-crate 3.4.0</a></li>
|
||||
<li><a href="https://github.com/dtolnay/proc-macro2">proc-macro2 1.0.105</a></li>
|
||||
<li><a href="https://github.com/dtolnay/quote">quote 1.0.43</a></li>
|
||||
<li><a href="https://github.com/dtolnay/proc-macro2">proc-macro2 1.0.106</a></li>
|
||||
<li><a href="https://github.com/dtolnay/quote">quote 1.0.44</a></li>
|
||||
<li><a href="https://github.com/bytecodealliance/rustix">rustix 0.38.44</a></li>
|
||||
<li><a href="https://github.com/bytecodealliance/rustix">rustix 1.1.3</a></li>
|
||||
<li><a href="https://github.com/dtolnay/rustversion">rustversion 1.0.22</a></li>
|
||||
@ -3942,11 +3944,11 @@ SOFTWARE.
|
||||
<li><a href="https://github.com/serde-rs/json">serde_json 1.0.149</a></li>
|
||||
<li><a href="https://github.com/dtolnay/syn">syn 2.0.114</a></li>
|
||||
<li><a href="https://github.com/dtolnay/thiserror">thiserror-impl 1.0.69</a></li>
|
||||
<li><a href="https://github.com/dtolnay/thiserror">thiserror-impl 2.0.17</a></li>
|
||||
<li><a href="https://github.com/dtolnay/thiserror">thiserror-impl 2.0.18</a></li>
|
||||
<li><a href="https://github.com/dtolnay/thiserror">thiserror 1.0.69</a></li>
|
||||
<li><a href="https://github.com/dtolnay/thiserror">thiserror 2.0.17</a></li>
|
||||
<li><a href="https://github.com/dtolnay/thiserror">thiserror 2.0.18</a></li>
|
||||
<li><a href="https://github.com/dtolnay/unicode-ident">unicode-ident 1.0.22</a></li>
|
||||
<li><a href="https://github.com/dtolnay/zmij">zmij 1.0.12</a></li>
|
||||
<li><a href="https://github.com/dtolnay/zmij">zmij 1.0.17</a></li>
|
||||
</ul>
|
||||
<pre class="license-text">Permission is hereby granted, free of charge, to any
|
||||
person obtaining a copy of this software and associated
|
||||
@ -4901,6 +4903,32 @@ dealings in these Data Files or Software without prior written
|
||||
authorization of the copyright holder.
|
||||
</pre>
|
||||
</li>
|
||||
<li class="license">
|
||||
<h3 id="Zlib">zlib License</h3>
|
||||
<h4>Used by:</h4>
|
||||
<ul class="license-used-by">
|
||||
<li><a href="https://github.com/orlp/foldhash">foldhash 0.1.5</a></li>
|
||||
</ul>
|
||||
<pre class="license-text">Copyright (c) 2024 Orson Peters
|
||||
|
||||
This software is provided 'as-is', without any express or implied warranty. In
|
||||
no event will the authors be held liable for any damages arising from the use of
|
||||
this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose, including
|
||||
commercial applications, and to alter it and redistribute it freely, subject to
|
||||
the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not claim
|
||||
that you wrote the original software. If you use this software in a product,
|
||||
an acknowledgment in the product documentation would be appreciated but is
|
||||
not required.
|
||||
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
|
||||
3. This notice may not be removed or altered from any source distribution.</pre>
|
||||
</li>
|
||||
</ul>
|
||||
</main>
|
||||
</body>
|
||||
|
||||
@ -910,7 +910,7 @@ You should also get your employer (if you work as a programmer) or school, if an
|
||||
|
||||
```
|
||||
|
||||
## pulldown-cmark-to-cmark 21.1.0
|
||||
## pulldown-cmark-to-cmark 22.0.0
|
||||
|
||||
```
|
||||
Apache License
|
||||
@ -1324,7 +1324,7 @@ You should also get your employer (if you work as a programmer) or school, if an
|
||||
|
||||
```
|
||||
|
||||
## prost-build 0.14.1, prost-derive 0.14.1, prost-types 0.14.1, prost 0.14.1
|
||||
## prost-build 0.14.3, prost-derive 0.14.3, prost-types 0.14.3, prost 0.14.3
|
||||
|
||||
```
|
||||
Apache License
|
||||
@ -1900,7 +1900,7 @@ SOFTWARE.
|
||||
|
||||
```
|
||||
|
||||
## cc 1.2.51, cfg-if 1.0.4, cmake 0.1.57, find-msvc-tools 0.1.6, pkg-config 0.3.32
|
||||
## cc 1.2.54, cfg-if 1.0.4, cmake 0.1.57, find-msvc-tools 0.1.8, pkg-config 0.3.32
|
||||
|
||||
```
|
||||
Copyright (c) 2014 Alex Crichton
|
||||
@ -1962,7 +1962,7 @@ DEALINGS IN THE SOFTWARE.
|
||||
|
||||
```
|
||||
|
||||
## base64ct 1.8.2
|
||||
## base64ct 1.8.3
|
||||
|
||||
```
|
||||
Copyright (c) 2014 Steve "Sc00bz" Thomas (steve at tobtu dot com)
|
||||
@ -2025,7 +2025,7 @@ DEALINGS IN THE SOFTWARE.
|
||||
|
||||
```
|
||||
|
||||
## uuid 1.19.0
|
||||
## uuid 1.20.0
|
||||
|
||||
```
|
||||
Copyright (c) 2014 The Rust Project Developers
|
||||
@ -2057,7 +2057,7 @@ DEALINGS IN THE SOFTWARE.
|
||||
|
||||
```
|
||||
|
||||
## libc 0.2.179
|
||||
## libc 0.2.180
|
||||
|
||||
```
|
||||
Copyright (c) 2014-2020 The Rust Project Developers
|
||||
@ -2114,7 +2114,7 @@ THE SOFTWARE.
|
||||
|
||||
```
|
||||
|
||||
## either 1.15.0, itertools 0.14.0, petgraph 0.7.1, serde_with 3.16.1, serde_with_macros 3.16.1
|
||||
## either 1.15.0, itertools 0.14.0, petgraph 0.8.3, serde_with 3.16.1, serde_with_macros 3.16.1
|
||||
|
||||
```
|
||||
Copyright (c) 2015
|
||||
@ -2402,7 +2402,7 @@ DEALINGS IN THE SOFTWARE.
|
||||
|
||||
```
|
||||
|
||||
## hashbrown 0.16.1
|
||||
## hashbrown 0.15.5, hashbrown 0.16.1
|
||||
|
||||
```
|
||||
Copyright (c) 2016 Amanieu d'Antras
|
||||
@ -2837,7 +2837,7 @@ DEALINGS IN THE SOFTWARE.
|
||||
|
||||
```
|
||||
|
||||
## getrandom 0.2.16
|
||||
## getrandom 0.2.17
|
||||
|
||||
```
|
||||
Copyright (c) 2018-2024 The rust-random Project Developers
|
||||
@ -3319,7 +3319,7 @@ SOFTWARE.
|
||||
|
||||
```
|
||||
|
||||
## rand 0.8.5, rand 0.9.2, rand_chacha 0.3.1, rand_chacha 0.9.0, rand_core 0.6.4, rand_core 0.9.3
|
||||
## rand 0.8.5, rand 0.9.2, rand_chacha 0.3.1, rand_chacha 0.9.0, rand_core 0.6.4, rand_core 0.9.5
|
||||
|
||||
```
|
||||
Copyright 2018 Developers of the Rand project
|
||||
@ -3351,7 +3351,7 @@ DEALINGS IN THE SOFTWARE.
|
||||
|
||||
```
|
||||
|
||||
## zerocopy-derive 0.8.33, zerocopy 0.8.33
|
||||
## zerocopy-derive 0.8.34, zerocopy 0.8.34
|
||||
|
||||
```
|
||||
Copyright 2023 The Fuchsia Authors
|
||||
@ -3621,7 +3621,7 @@ SOFTWARE.
|
||||
|
||||
```
|
||||
|
||||
## curve25519-dalek-derive 0.1.1, anyhow 1.0.100, displaydoc 0.2.5, fastrand 2.3.0, home 0.5.12, itoa 1.0.17, linkme-impl 0.3.35, linkme 0.3.35, linux-raw-sys 0.11.0, linux-raw-sys 0.4.15, num_enum 0.7.5, num_enum_derive 0.7.5, once_cell 1.21.3, prettyplease 0.2.37, proc-macro-crate 3.4.0, proc-macro2 1.0.105, quote 1.0.43, rustix 0.38.44, rustix 1.1.3, rustversion 1.0.22, semver 1.0.27, send_wrapper 0.6.0, serde 1.0.228, serde_core 1.0.228, serde_derive 1.0.228, serde_json 1.0.149, syn 2.0.114, thiserror-impl 1.0.69, thiserror-impl 2.0.17, thiserror 1.0.69, thiserror 2.0.17, unicode-ident 1.0.22, zmij 1.0.12
|
||||
## curve25519-dalek-derive 0.1.1, anyhow 1.0.100, displaydoc 0.2.5, fastrand 2.3.0, home 0.5.12, itoa 1.0.17, linkme-impl 0.3.35, linkme 0.3.35, linux-raw-sys 0.11.0, linux-raw-sys 0.4.15, num_enum 0.7.5, num_enum_derive 0.7.5, once_cell 1.21.3, prettyplease 0.2.37, proc-macro-crate 3.4.0, proc-macro2 1.0.106, quote 1.0.44, rustix 0.38.44, rustix 1.1.3, rustversion 1.0.22, semver 1.0.27, send_wrapper 0.6.0, serde 1.0.228, serde_core 1.0.228, serde_derive 1.0.228, serde_json 1.0.149, syn 2.0.114, thiserror-impl 1.0.69, thiserror-impl 2.0.18, thiserror 1.0.69, thiserror 2.0.18, unicode-ident 1.0.22, zmij 1.0.17
|
||||
|
||||
```
|
||||
Permission is hereby granted, free of charge, to any
|
||||
@ -4533,3 +4533,27 @@ authorization of the copyright holder.
|
||||
|
||||
```
|
||||
|
||||
## foldhash 0.1.5
|
||||
|
||||
```
|
||||
Copyright (c) 2024 Orson Peters
|
||||
|
||||
This software is provided 'as-is', without any express or implied warranty. In
|
||||
no event will the authors be held liable for any damages arising from the use of
|
||||
this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose, including
|
||||
commercial applications, and to alter it and redistribute it freely, subject to
|
||||
the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not claim
|
||||
that you wrote the original software. If you use this software in a product,
|
||||
an acknowledgment in the product documentation would be appreciated but is
|
||||
not required.
|
||||
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
```
|
||||
|
||||
|
||||
@ -1135,7 +1135,7 @@ You should also get your employer (if you work as a programmer) or school, if an
|
||||
<key>License</key>
|
||||
<string>Apache License 2.0</string>
|
||||
<key>Title</key>
|
||||
<string>pulldown-cmark-to-cmark 21.1.0</string>
|
||||
<string>pulldown-cmark-to-cmark 22.0.0</string>
|
||||
<key>Type</key>
|
||||
<string>PSGroupSpecifier</string>
|
||||
</dict>
|
||||
@ -1557,7 +1557,7 @@ limitations under the License.
|
||||
<key>License</key>
|
||||
<string>Apache License 2.0</string>
|
||||
<key>Title</key>
|
||||
<string>prost-build 0.14.1, prost-derive 0.14.1, prost-types 0.14.1, prost 0.14.1</string>
|
||||
<string>prost-build 0.14.3, prost-derive 0.14.3, prost-types 0.14.3, prost 0.14.3</string>
|
||||
<key>Type</key>
|
||||
<string>PSGroupSpecifier</string>
|
||||
</dict>
|
||||
@ -2005,7 +2005,7 @@ DEALINGS IN THE SOFTWARE.
|
||||
<key>License</key>
|
||||
<string>MIT License</string>
|
||||
<key>Title</key>
|
||||
<string>cc 1.2.51, cfg-if 1.0.4, cmake 0.1.57, find-msvc-tools 0.1.6, pkg-config 0.3.32</string>
|
||||
<string>cc 1.2.54, cfg-if 1.0.4, cmake 0.1.57, find-msvc-tools 0.1.8, pkg-config 0.3.32</string>
|
||||
<key>Type</key>
|
||||
<string>PSGroupSpecifier</string>
|
||||
</dict>
|
||||
@ -2076,7 +2076,7 @@ DEALINGS IN THE SOFTWARE.
|
||||
<key>License</key>
|
||||
<string>MIT License</string>
|
||||
<key>Title</key>
|
||||
<string>base64ct 1.8.2</string>
|
||||
<string>base64ct 1.8.3</string>
|
||||
<key>Type</key>
|
||||
<string>PSGroupSpecifier</string>
|
||||
</dict>
|
||||
@ -2147,7 +2147,7 @@ DEALINGS IN THE SOFTWARE.
|
||||
<key>License</key>
|
||||
<string>MIT License</string>
|
||||
<key>Title</key>
|
||||
<string>uuid 1.19.0</string>
|
||||
<string>uuid 1.20.0</string>
|
||||
<key>Type</key>
|
||||
<string>PSGroupSpecifier</string>
|
||||
</dict>
|
||||
@ -2182,7 +2182,7 @@ DEALINGS IN THE SOFTWARE.
|
||||
<key>License</key>
|
||||
<string>MIT License</string>
|
||||
<key>Title</key>
|
||||
<string>libc 0.2.179</string>
|
||||
<string>libc 0.2.180</string>
|
||||
<key>Type</key>
|
||||
<string>PSGroupSpecifier</string>
|
||||
</dict>
|
||||
@ -2247,7 +2247,7 @@ DEALINGS IN THE SOFTWARE.
|
||||
<key>License</key>
|
||||
<string>MIT License</string>
|
||||
<key>Title</key>
|
||||
<string>either 1.15.0, itertools 0.14.0, petgraph 0.7.1, serde_with 3.16.1, serde_with_macros 3.16.1</string>
|
||||
<string>either 1.15.0, itertools 0.14.0, petgraph 0.8.3, serde_with 3.16.1, serde_with_macros 3.16.1</string>
|
||||
<key>Type</key>
|
||||
<string>PSGroupSpecifier</string>
|
||||
</dict>
|
||||
@ -2575,7 +2575,7 @@ DEALINGS IN THE SOFTWARE.
|
||||
<key>License</key>
|
||||
<string>MIT License</string>
|
||||
<key>Title</key>
|
||||
<string>hashbrown 0.16.1</string>
|
||||
<string>hashbrown 0.15.5, hashbrown 0.16.1</string>
|
||||
<key>Type</key>
|
||||
<string>PSGroupSpecifier</string>
|
||||
</dict>
|
||||
@ -3067,7 +3067,7 @@ DEALINGS IN THE SOFTWARE.
|
||||
<key>License</key>
|
||||
<string>MIT License</string>
|
||||
<key>Title</key>
|
||||
<string>getrandom 0.2.16</string>
|
||||
<string>getrandom 0.2.17</string>
|
||||
<key>Type</key>
|
||||
<string>PSGroupSpecifier</string>
|
||||
</dict>
|
||||
@ -3613,7 +3613,7 @@ DEALINGS IN THE SOFTWARE.
|
||||
<key>License</key>
|
||||
<string>MIT License</string>
|
||||
<key>Title</key>
|
||||
<string>rand 0.8.5, rand 0.9.2, rand_chacha 0.3.1, rand_chacha 0.9.0, rand_core 0.6.4, rand_core 0.9.3</string>
|
||||
<string>rand 0.8.5, rand 0.9.2, rand_chacha 0.3.1, rand_chacha 0.9.0, rand_core 0.6.4, rand_core 0.9.5</string>
|
||||
<key>Type</key>
|
||||
<string>PSGroupSpecifier</string>
|
||||
</dict>
|
||||
@ -3649,7 +3649,7 @@ DEALINGS IN THE SOFTWARE.
|
||||
<key>License</key>
|
||||
<string>MIT License</string>
|
||||
<key>Title</key>
|
||||
<string>zerocopy-derive 0.8.33, zerocopy 0.8.33</string>
|
||||
<string>zerocopy-derive 0.8.34, zerocopy 0.8.34</string>
|
||||
<key>Type</key>
|
||||
<string>PSGroupSpecifier</string>
|
||||
</dict>
|
||||
@ -3956,7 +3956,7 @@ DEALINGS IN THE SOFTWARE.
|
||||
<key>License</key>
|
||||
<string>MIT License</string>
|
||||
<key>Title</key>
|
||||
<string>curve25519-dalek-derive 0.1.1, anyhow 1.0.100, displaydoc 0.2.5, fastrand 2.3.0, home 0.5.12, itoa 1.0.17, linkme-impl 0.3.35, linkme 0.3.35, linux-raw-sys 0.11.0, linux-raw-sys 0.4.15, num_enum 0.7.5, num_enum_derive 0.7.5, once_cell 1.21.3, prettyplease 0.2.37, proc-macro-crate 3.4.0, proc-macro2 1.0.105, quote 1.0.43, rustix 0.38.44, rustix 1.1.3, rustversion 1.0.22, semver 1.0.27, send_wrapper 0.6.0, serde 1.0.228, serde_core 1.0.228, serde_derive 1.0.228, serde_json 1.0.149, syn 2.0.114, thiserror-impl 1.0.69, thiserror-impl 2.0.17, thiserror 1.0.69, thiserror 2.0.17, unicode-ident 1.0.22, zmij 1.0.12</string>
|
||||
<string>curve25519-dalek-derive 0.1.1, anyhow 1.0.100, displaydoc 0.2.5, fastrand 2.3.0, home 0.5.12, itoa 1.0.17, linkme-impl 0.3.35, linkme 0.3.35, linux-raw-sys 0.11.0, linux-raw-sys 0.4.15, num_enum 0.7.5, num_enum_derive 0.7.5, once_cell 1.21.3, prettyplease 0.2.37, proc-macro-crate 3.4.0, proc-macro2 1.0.106, quote 1.0.44, rustix 0.38.44, rustix 1.1.3, rustversion 1.0.22, semver 1.0.27, send_wrapper 0.6.0, serde 1.0.228, serde_core 1.0.228, serde_derive 1.0.228, serde_json 1.0.149, syn 2.0.114, thiserror-impl 1.0.69, thiserror-impl 2.0.18, thiserror 1.0.69, thiserror 2.0.18, unicode-ident 1.0.22, zmij 1.0.17</string>
|
||||
<key>Type</key>
|
||||
<string>PSGroupSpecifier</string>
|
||||
</dict>
|
||||
@ -4919,6 +4919,34 @@ authorization of the copyright holder.
|
||||
<key>Type</key>
|
||||
<string>PSGroupSpecifier</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>FooterText</key>
|
||||
<string>Copyright (c) 2024 Orson Peters
|
||||
|
||||
This software is provided 'as-is', without any express or implied warranty. In
|
||||
no event will the authors be held liable for any damages arising from the use of
|
||||
this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose, including
|
||||
commercial applications, and to alter it and redistribute it freely, subject to
|
||||
the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not claim
|
||||
that you wrote the original software. If you use this software in a product,
|
||||
an acknowledgment in the product documentation would be appreciated but is
|
||||
not required.
|
||||
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
|
||||
3. This notice may not be removed or altered from any source distribution.</string>
|
||||
<key>License</key>
|
||||
<string>zlib License</string>
|
||||
<key>Title</key>
|
||||
<string>foldhash 0.1.5</string>
|
||||
<key>Type</key>
|
||||
<string>PSGroupSpecifier</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>FooterText</key>
|
||||
<string>Generated by cargo-about</string>
|
||||
|
||||
@ -7,6 +7,7 @@
|
||||
|
||||
import argparse
|
||||
import hashlib
|
||||
import json
|
||||
import os
|
||||
import platform
|
||||
import ssl
|
||||
@ -18,16 +19,18 @@ from typing import BinaryIO
|
||||
|
||||
UNVERIFIED_DOWNLOAD_NAME = "unverified.tmp"
|
||||
|
||||
PREBUILD_CHECKSUMS = {
|
||||
'android': '520be7a10fa6c796cba29a790c8bf839b2e9f08b06b9314ebb165f0d76bbf7f9',
|
||||
'ios': '5421d640ce6f598a42cbc22eeb74223135d6d9869f8929d6bd5acaf0722527ff',
|
||||
'linux-x64': '9135254b5b230b50ddbe6787d85715676ccc41636af331bef670303762153c99',
|
||||
'linux-arm64': '3e9a4eab524c386fa87a30f3ff2156f375e563bed2b9e3ba5a78917f8dd76e70',
|
||||
'mac-x64': '36d19d0ee14a0bbe45dc24298b1b211ec4ee11b7d891c585feb43383e4d8920f',
|
||||
'mac-arm64': '30cd81aca0f9c8f971895b584104f8412abd3c7a067f49c5b8322e1b7beebf2f',
|
||||
'windows-x64': '51fa1684901009f04684c45f039a9cbf48be2b7cf5242ad730b203adf69bd0c0',
|
||||
'windows-arm64': '5cf450c5fc0cb50840e5c18dc97afeb9a17c5ea7b359949b8c9af62adcf7770a',
|
||||
}
|
||||
fetch_script_file_path = os.path.realpath(__file__)
|
||||
fetch_script_file_dir = os.path.dirname(fetch_script_file_path)
|
||||
|
||||
try:
|
||||
with open("{}/../config/webrtc_artifact_checksums.json".format(fetch_script_file_dir), 'r') as file:
|
||||
PREBUILD_CHECKSUMS = json.load(file)
|
||||
except FileNotFoundError:
|
||||
print("The artifact checksum file was not found.")
|
||||
exit(1)
|
||||
except json.JSONDecodeError:
|
||||
print("The artifact checksum file contains invalid JSON.")
|
||||
exit(1)
|
||||
|
||||
|
||||
def resolve_os(os_name: str) -> str:
|
||||
|
||||
@ -29,7 +29,7 @@ relative-path = "2.0.1"
|
||||
serde = { version = "1.0.228", features = ["derive"] }
|
||||
serde_json = "1.0.145"
|
||||
sha2 = "0.10.9"
|
||||
tokio = { version = "1.48.0", features = ["rt-multi-thread", "macros", "time", "fs", "process"] }
|
||||
tokio = { version = "1.48.0", features = ["rt-multi-thread", "macros", "time", "fs", "process", "io-std"] }
|
||||
tonic = "0.14.2"
|
||||
tonic-prost = "0.14.2"
|
||||
tower = { version = "0.5.2", features = ["timeout"] }
|
||||
|
||||
10
config/webrtc_artifact_checksums.json
Normal file
10
config/webrtc_artifact_checksums.json
Normal file
@ -0,0 +1,10 @@
|
||||
{
|
||||
"android": "520be7a10fa6c796cba29a790c8bf839b2e9f08b06b9314ebb165f0d76bbf7f9",
|
||||
"ios": "5421d640ce6f598a42cbc22eeb74223135d6d9869f8929d6bd5acaf0722527ff",
|
||||
"linux-x64": "9135254b5b230b50ddbe6787d85715676ccc41636af331bef670303762153c99",
|
||||
"linux-arm64": "3e9a4eab524c386fa87a30f3ff2156f375e563bed2b9e3ba5a78917f8dd76e70",
|
||||
"mac-x64": "36d19d0ee14a0bbe45dc24298b1b211ec4ee11b7d891c585feb43383e4d8920f",
|
||||
"mac-arm64": "30cd81aca0f9c8f971895b584104f8412abd3c7a067f49c5b8322e1b7beebf2f",
|
||||
"windows-x64": "51fa1684901009f04684c45f039a9cbf48be2b7cf5242ad730b203adf69bd0c0",
|
||||
"windows-arm64": "5cf450c5fc0cb50840e5c18dc97afeb9a17c5ea7b359949b8c9af62adcf7770a"
|
||||
}
|
||||
17
webrtc-sys/Cargo.toml
Normal file
17
webrtc-sys/Cargo.toml
Normal file
@ -0,0 +1,17 @@
|
||||
[package]
|
||||
name = "webrtc-sys"
|
||||
edition = "2024"
|
||||
version.workspace = true
|
||||
authors.workspace = true
|
||||
|
||||
[features]
|
||||
prebuilt-webrtc = ["webrtc-sys-build/prebuilt-webrtc"]
|
||||
simulator = ["webrtc-sys-build/simulator"]
|
||||
|
||||
[lib]
|
||||
crate-type = ["cdylib", "staticlib", "lib"]
|
||||
|
||||
[build-dependencies]
|
||||
anyhow = "1.0.100"
|
||||
webrtc-sys-build = { path = "./build" }
|
||||
xshell = "0.2.7"
|
||||
30
webrtc-sys/build.rs
Normal file
30
webrtc-sys/build.rs
Normal file
@ -0,0 +1,30 @@
|
||||
//
|
||||
// Copyright 2025 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
//
|
||||
|
||||
use std::fs;
|
||||
|
||||
use webrtc_sys_build::webrtc::{self, config::*};
|
||||
|
||||
fn main() -> anyhow::Result<()> {
|
||||
println!(
|
||||
"webrtc-sys build.rs: profile: {}, test: {}, os: {}, arch: {}, sim: {} webrtc_output_dir: {}, workspace_dir: {}",
|
||||
*PROFILE, IS_TEST, *TARGET_OS, *TARGET_ARCH, TARGET_SIMULATOR, *OUTPUT_DIR, *WORKSPACE_DIR
|
||||
);
|
||||
|
||||
webrtc::verify_webrtc_target()?;
|
||||
println!("cargo:rerun-if-env-changed=OUTPUT_DIR");
|
||||
println!("cargo:rerun-if-changed=build.rs");
|
||||
println!("cargo:rerun-if-changed=libwebrtc/*");
|
||||
println!("cargo:rerun-if-changed=src/*");
|
||||
|
||||
fs::create_dir_all(WEBRTC_DEST_DIR.as_str())?;
|
||||
if webrtc::should_use_prebuilt() {
|
||||
webrtc::download_prebuilt()?;
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
let sh = webrtc::prepare_workspace_shell()?;
|
||||
webrtc::build_webrtc_from_source(sh)
|
||||
}
|
||||
23
webrtc-sys/build/Cargo.toml
Normal file
23
webrtc-sys/build/Cargo.toml
Normal file
@ -0,0 +1,23 @@
|
||||
[package]
|
||||
name = "webrtc-sys-build"
|
||||
version = "0.1.0"
|
||||
edition = "2024"
|
||||
|
||||
[features]
|
||||
prebuilt-webrtc = []
|
||||
simulator = []
|
||||
|
||||
[dependencies]
|
||||
anyhow = "1.0.100"
|
||||
bzip2 = "0.6.1"
|
||||
fs_extra = "1.3.0"
|
||||
hex = "0.4.3"
|
||||
java-properties = "2.0.0"
|
||||
reqwest = { version = "0.12.24", features = [
|
||||
"blocking",
|
||||
] } # Use "blocking" feature for simpler synchronous code
|
||||
serde_json = "1.0.145"
|
||||
sha2 = "0.10.9"
|
||||
tar = "0.4.44"
|
||||
which = "7.0.0"
|
||||
xshell = "0.2.7"
|
||||
22
webrtc-sys/build/README.md
Normal file
22
webrtc-sys/build/README.md
Normal file
@ -0,0 +1,22 @@
|
||||
## Expected directory structure
|
||||
|
||||
```
|
||||
|- webrtc-sys
|
||||
|- build.rs
|
||||
|- src/
|
||||
| |- ...
|
||||
|- libwebrtc
|
||||
| |- .gclient
|
||||
| |- artifact_checksums.json
|
||||
| |- version.properties
|
||||
| |- src
|
||||
| |- .git
|
||||
| |- out
|
||||
| |- ...
|
||||
| |- ...
|
||||
|- out
|
||||
|- <os_arch>
|
||||
|- <profile>
|
||||
|- obj
|
||||
|- libwebrtc.so
|
||||
```
|
||||
12
webrtc-sys/build/WebRTCForTesting.podspec.tpl
Normal file
12
webrtc-sys/build/WebRTCForTesting.podspec.tpl
Normal file
@ -0,0 +1,12 @@
|
||||
Pod::Spec.new do |s|
|
||||
s.name = "WebRTCForTesting"
|
||||
s.version = "0.0.1"
|
||||
s.summary = "Intended only for testing SignalRingRTC within this repository"
|
||||
s.license = "BSD"
|
||||
s.homepage = "https://github.com/signalapp/webrtc"
|
||||
s.source = {{ git: "https://github.com/signalapp/webrtc.git" }}
|
||||
s.author = {{ "iOS Team": "ios@signal.org" }}
|
||||
|
||||
s.platform = :ios, "'{}'"
|
||||
s.vendored_frameworks = "'{}'/WebRTC.xcframework"
|
||||
end
|
||||
6
webrtc-sys/build/src/lib.rs
Normal file
6
webrtc-sys/build/src/lib.rs
Normal file
@ -0,0 +1,6 @@
|
||||
//
|
||||
// Copyright 2025 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
//
|
||||
|
||||
pub mod webrtc;
|
||||
496
webrtc-sys/build/src/webrtc.rs
Normal file
496
webrtc-sys/build/src/webrtc.rs
Normal file
@ -0,0 +1,496 @@
|
||||
//
|
||||
// Copyright 2025 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
//
|
||||
|
||||
use core::panic;
|
||||
use std::{
|
||||
collections::HashMap,
|
||||
fs::{self, File, OpenOptions},
|
||||
io::{self, BufReader, Read, Seek},
|
||||
path::Path,
|
||||
};
|
||||
|
||||
use anyhow::bail;
|
||||
use config::*;
|
||||
use sha2::{Digest, Sha256};
|
||||
use xshell::{Shell, cmd};
|
||||
|
||||
pub fn prepare_workspace_shell() -> anyhow::Result<Shell> {
|
||||
let mut sh = Shell::new()?;
|
||||
if *TARGET_PLATFORM == "windows" {
|
||||
sh.set_var("DEPOT_TOOLS_WIN_TOOLCHAIN", "0");
|
||||
}
|
||||
|
||||
ensure_chromium_depot_tools(&mut sh)?;
|
||||
sync_webrtc_source(&mut sh)?;
|
||||
Ok(sh)
|
||||
}
|
||||
|
||||
pub fn ensure_chromium_depot_tools(sh: &mut Shell) -> anyhow::Result<()> {
|
||||
if which::which("gclient").is_ok() {
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
let depot_tools_path = format!("{}/depot_tools", *OUTPUT_DIR);
|
||||
if !Path::new(&depot_tools_path).exists() {
|
||||
cmd!(sh, "git clone --depth 1 https://chromium.googlesource.com/chromium/tools/depot_tools.git {depot_tools_path}").run()?;
|
||||
}
|
||||
sh.set_var(
|
||||
"PATH",
|
||||
format!("{depot_tools_path}:{}", sh.var("PATH").unwrap()),
|
||||
);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn sync_webrtc_source(sh: &mut Shell) -> anyhow::Result<()> {
|
||||
println!(
|
||||
"Syncing WebRTC source version '{}' to directory {}",
|
||||
*WEBRTC_VERSION, *LIBWEBRTC_DIR
|
||||
);
|
||||
let gclient_file = *GCLIENT_FILE;
|
||||
let revision = WEBRTC_VERSION.as_str();
|
||||
sh.change_dir(LIBWEBRTC_DIR.as_str());
|
||||
let env_vars = HashMap::from([
|
||||
("WEBRTC_DIR", LIBWEBRTC_DIR.clone()),
|
||||
("WEBRTC_VERSION", WEBRTC_VERSION.clone()),
|
||||
(
|
||||
"WEBRTC_REVISION",
|
||||
format!("branch-heads/{}", *WEBRTC_VERSION),
|
||||
),
|
||||
]);
|
||||
cmd!(
|
||||
sh,
|
||||
"gclient sync --no-history --jobs 32 --with_tags --revision=src@{revision} --gclientfile={gclient_file}"
|
||||
)
|
||||
.envs(env_vars)
|
||||
.run()?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn build_webrtc_from_source(sh: Shell) -> anyhow::Result<()> {
|
||||
match *TARGET_PLATFORM {
|
||||
"ios" => build_webrtc_for_ios(sh),
|
||||
"android" => build_webrtc_for_android(sh),
|
||||
"desktop" => build_webrtc_for_desktop(sh),
|
||||
_ => bail!("Unsupported target platform {}", *TARGET_PLATFORM),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn common_webrtc_flags() -> Vec<String> {
|
||||
let target_os = match TARGET_OS.as_str() {
|
||||
"macos" => "target_os=\"mac\"".to_string(),
|
||||
os => format!("target_os=\"{os}\""),
|
||||
};
|
||||
let symbol_level = if *IS_RELEASE { 1 } else { 2 };
|
||||
let include_tests = *IS_DESKTOP && IS_TEST;
|
||||
vec![
|
||||
target_os,
|
||||
format!("is_debug={}", !*IS_RELEASE),
|
||||
format!("rtc_include_tests={include_tests}"),
|
||||
format!("rtc_enable_protobuf={include_tests}"),
|
||||
format!("symbol_level={symbol_level}"),
|
||||
"rtc_build_examples=false".to_string(),
|
||||
"rtc_build_tools=false".to_string(),
|
||||
"rtc_enable_sctp=false".to_string(),
|
||||
"rtc_disable_metrics=true".to_string(),
|
||||
"rtc_disable_trace_events=true".to_string(),
|
||||
]
|
||||
}
|
||||
|
||||
pub fn build_webrtc_for_desktop(sh: Shell) -> anyhow::Result<()> {
|
||||
let working_dir = format!("{}/src", *LIBWEBRTC_DIR);
|
||||
let dest = format!("out/{}/{}", *TARGET_KEY, *PROFILE);
|
||||
sh.change_dir(&working_dir);
|
||||
|
||||
let gnu_arch = DESKTOP_TARGET_ARCH_TO_GNU_ARCH[TARGET_ARCH.as_str()];
|
||||
let mut args = common_webrtc_flags();
|
||||
args.extend(vec![
|
||||
format!("target_cpu=\"{gnu_arch}\""),
|
||||
"rtc_use_x11=false".to_string(),
|
||||
"rtc_libvpx_build_vp9=true".to_string(),
|
||||
"use_siso=true".to_string(),
|
||||
]);
|
||||
if TARGET_OS.as_str() == "linux" && gnu_arch == "arm64" {
|
||||
args.push("libyuv_use_sme=false".to_string());
|
||||
// Ensure that experimental compact relocation is disabled until upstream projects properly set it.
|
||||
// https://issues.webrtc.org/issues/407797634
|
||||
// https://chromium-review.googlesource.com/c/chromium/src/+/5938657
|
||||
cmd!(
|
||||
sh,
|
||||
"sed -i '/^[^#].*--allow-experimental-crel/ s/^/#/' src/webrtc/src/build/config/compiler/BUILD.gn"
|
||||
).run()?;
|
||||
}
|
||||
let args_flag = args.join(" ");
|
||||
cmd!(sh, "gn gen -C {dest} --args={args_flag}").run()?;
|
||||
cmd!(sh, "third_party/siso/cipd/siso ninja -C {dest} webrtc").run()?;
|
||||
if IS_TEST {
|
||||
cmd!(sh, "third_party/siso/cipd/siso ninja -C {dest} default").run()?;
|
||||
cmd!(sh, "download_from_google_storage --directory --recursive --num_threads=10 --no_auth --quiet --bucket chromium-webrtc-resources resources")
|
||||
.run()?;
|
||||
}
|
||||
cmd!(
|
||||
sh,
|
||||
"tools_webrtc/libs/generate_licenses.py --target :webrtc {dest} {dest}"
|
||||
)
|
||||
.run()?;
|
||||
|
||||
let filename = if *TARGET_PLATFORM == "windows" {
|
||||
"webrtc.lib"
|
||||
} else {
|
||||
"libwebrtc.a"
|
||||
};
|
||||
let from = format!("{working_dir}/{dest}/obj/{filename}");
|
||||
let to = format!("{}/{}", *WEBRTC_DEST_DIR, filename);
|
||||
let err_msg = format!("could not copy webrtc lib from {from} to {to}");
|
||||
fs::copy(from, to).expect(&err_msg);
|
||||
let from = format!("{working_dir}/{dest}/LICENSE.md");
|
||||
let to = format!("{}/{}/{}/LICENSE.md", *OUTPUT_DIR, *TARGET_KEY, *PROFILE);
|
||||
let err_msg = format!("could not copy webrtc license from {from} to {to}");
|
||||
fs::copy(from, to).expect(&err_msg);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn build_webrtc_for_ios(sh: Shell) -> anyhow::Result<()> {
|
||||
const IPHONEOS_DEPLOYMENT_TARGET: &str = "14.0";
|
||||
let profile = PROFILE.as_str();
|
||||
let mut args = common_webrtc_flags();
|
||||
args.extend(vec![
|
||||
format!("enable_dsyms={}", !*IS_RELEASE),
|
||||
"rtc_libvpx_build_vp9=false".to_string(),
|
||||
]);
|
||||
let working_dir = format!("{}/src", *LIBWEBRTC_DIR);
|
||||
let dest = format!("{}/out/ios/{}", working_dir, *PROFILE);
|
||||
let library_dest = WEBRTC_DEST_DIR.as_str();
|
||||
let xcframework_dest = format!("{library_dest}/WebRTC.xcframework");
|
||||
let bin_dir = format!("{}/bin", *WORKSPACE_DIR);
|
||||
let webrtc_version = WEBRTC_VERSION.as_str();
|
||||
let ringrtc_version = RINGRTC_VERSION.as_str();
|
||||
|
||||
sh.change_dir(working_dir);
|
||||
cmd!(
|
||||
sh,
|
||||
"tools_webrtc/ios/build_ios_libs.py -o {dest} --build_config {profile} --arch simulator:x64 simulator:arm64 device:arm64 --deployment-target {IPHONEOS_DEPLOYMENT_TARGET} --extra-gn-args {args...}"
|
||||
).run()?;
|
||||
cmd!(sh, "cp -Rf {dest}/WebRTC.xcframework {library_dest}").run()?;
|
||||
let build_env = cmd!(sh, "{bin_dir}/print_build_env.py --webrtc-version={webrtc_version} --ringrtc-version={ringrtc_version}").read().unwrap();
|
||||
fs::write(format!("{xcframework_dest}/build_env.txt"), build_env)
|
||||
.expect("failed to write build_env.txt");
|
||||
// Delete dSYMs out of the built XCFramework.
|
||||
// FIXME: In the future, we probably want to keep these,
|
||||
// which is why we aren't changing WebRTC's build script to skip them altogether.
|
||||
// We enumerate directories since we can't use parameter expansion with xshell
|
||||
cmd!(sh, "rm -r {xcframework_dest}/ios-arm64/dSYMs").run()?;
|
||||
cmd!(
|
||||
sh,
|
||||
"rm -r {xcframework_dest}/ios-arm64_x86_64-simulator/dSYMs"
|
||||
)
|
||||
.run()?;
|
||||
cmd!(
|
||||
sh,
|
||||
"plutil -remove AvailableLibraries.DebugSymbolsPath {xcframework_dest}/Info.plist"
|
||||
)
|
||||
.run()?;
|
||||
|
||||
let podspec = format!(
|
||||
include_str!("../WebRTCForTesting.podspec.tpl"),
|
||||
IPHONEOS_DEPLOYMENT_TARGET, profile
|
||||
);
|
||||
fs::write(format!("{library_dest}/WebRTCForTesting.podspec"), podspec)
|
||||
.expect("failed to write podspec");
|
||||
let acknowledgements = cmd!(
|
||||
sh,
|
||||
"{bin_dir}/convert_webrtc_acknowledgments.py -f plist {xcframework_dest}/LICENSE.md"
|
||||
)
|
||||
.read()?;
|
||||
fs::write(
|
||||
format!("{library_dest}/acknowledgments-webrtc-ios.plist"),
|
||||
acknowledgements,
|
||||
)
|
||||
.expect("failed to write acknowledgements");
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn build_webrtc_for_android(sh: Shell) -> anyhow::Result<()> {
|
||||
let gnu_arch = ANDROID_TARGET_ARCH_TO_GNU_ARCH[TARGET_ARCH.as_str()];
|
||||
let profile = PROFILE.as_str();
|
||||
let mut args = common_webrtc_flags();
|
||||
args.extend(vec![
|
||||
format!("target_cpu={gnu_arch}"),
|
||||
"rtc_libvpx_build_vp9=false".to_string(),
|
||||
"android_static_analysis=\"off\"".to_string(),
|
||||
"use_siso=true".to_string(),
|
||||
]);
|
||||
let args_flag = args.join(" ");
|
||||
let working_dir = format!("{}/src", *LIBWEBRTC_DIR);
|
||||
let dest = format!("{working_dir}/out/android-{gnu_arch}/{profile}");
|
||||
let library_dest = WEBRTC_DEST_DIR.as_str();
|
||||
let path = "lib.java/sdk/android";
|
||||
let filename = "libwebrtc.jar";
|
||||
|
||||
sh.change_dir(working_dir);
|
||||
cmd!(sh, "gn gen -C {dest} --args={args_flag}").run()?;
|
||||
cmd!(sh, "third_party/siso/cipd/siso ninja -C {dest} ringrtc").run()?;
|
||||
cmd!(sh, "cp -Rf {dest} {library_dest}").run()?;
|
||||
cmd!(sh, "mkdir -p {path}").run()?;
|
||||
cmd!(
|
||||
sh,
|
||||
"cp -Rf {dest}/{path}/{filename} {library_dest}/{path}/{filename}"
|
||||
)
|
||||
.run()?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn should_use_prebuilt() -> bool {
|
||||
let has_prebuilt_env: Option<&'static str> = option_env!("PREBUILT_WEBRTC");
|
||||
let has_prebuilt_feature = cfg!(feature = "prebuilt-webrtc");
|
||||
|
||||
has_prebuilt_env
|
||||
.and_then(|s: &str| s.parse::<u8>().ok())
|
||||
.and_then(|b| match b {
|
||||
0 => Some(false),
|
||||
1 => Some(true),
|
||||
_ => None,
|
||||
})
|
||||
.unwrap_or(has_prebuilt_feature)
|
||||
}
|
||||
|
||||
pub fn download_prebuilt() -> anyhow::Result<()> {
|
||||
let expected_checksum = ARTIFACT_CHECKSUMS
|
||||
.get(TARGET_KEY.as_str())
|
||||
.unwrap_or_else(|| panic!("could not find checksum for artifact key: {}", *TARGET_KEY))
|
||||
.as_str()
|
||||
.expect("artifact checksum must be string");
|
||||
let archive_filename = format!(
|
||||
"webrtc-{}-{}-{}.tar.bz2",
|
||||
*WEBRTC_VERSION, *TARGET_PAIR, *PROFILE
|
||||
);
|
||||
let archive_local_dir = format!("{}/{}", *OUTPUT_DIR, *TARGET_KEY);
|
||||
let archive_local_path = format!("{}/{}", archive_local_dir, archive_filename);
|
||||
let download_url = format!("https://build-artifacts.signal.org/libraries/{archive_filename}");
|
||||
let temporary_path = format!("{}/unverified.tar.bz2", archive_local_dir);
|
||||
|
||||
println!("Looking for artifact in {archive_local_path} with checksum {expected_checksum}");
|
||||
let mut archive_file = OpenOptions::new()
|
||||
.read(true)
|
||||
.open(&archive_local_path)
|
||||
.or_else(|_| download_file(&download_url, &temporary_path))
|
||||
.expect("failed to download prebuilt-webrtc artifact");
|
||||
|
||||
let checksum = calculate_sha256(&mut archive_file).expect("Failed to checksum");
|
||||
if checksum != expected_checksum {
|
||||
bail!(
|
||||
"download checksum did not match expected checksum: {checksum} vs {expected_checksum}"
|
||||
);
|
||||
}
|
||||
let _ = fs::rename(temporary_path, archive_local_path);
|
||||
archive_file
|
||||
.rewind()
|
||||
.expect("failed to seek to start of archive file");
|
||||
let decoder = bzip2::read::BzDecoder::new(BufReader::new(archive_file));
|
||||
let mut archive = tar::Archive::new(decoder);
|
||||
archive
|
||||
.unpack(archive_local_dir)
|
||||
.expect("failed to decompress webrtc artifact");
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn calculate_sha256(file: &mut File) -> io::Result<String> {
|
||||
file.rewind()?;
|
||||
let mut hasher = Sha256::new();
|
||||
let mut buffer = [0; 1024]; // Buffer to read file in chunks
|
||||
loop {
|
||||
let bytes_read = file.read(&mut buffer)?;
|
||||
if bytes_read == 0 {
|
||||
break;
|
||||
}
|
||||
hasher.update(&buffer[..bytes_read]);
|
||||
}
|
||||
|
||||
let hash_bytes = hasher.finalize();
|
||||
Ok(hex::encode(hash_bytes))
|
||||
}
|
||||
|
||||
pub fn download_file(url: &str, filename: &str) -> anyhow::Result<File> {
|
||||
println!("Downloading from {url} to local file {filename}");
|
||||
fs::create_dir_all(Path::new(filename).parent().unwrap())
|
||||
.expect("could not make target download folder");
|
||||
let mut response = reqwest::blocking::get(url)?.error_for_status()?;
|
||||
let mut file = OpenOptions::new()
|
||||
.read(true)
|
||||
.truncate(true)
|
||||
.create(true)
|
||||
.write(true)
|
||||
.open(filename)?;
|
||||
std::io::copy(&mut response, &mut file)?;
|
||||
Ok(file)
|
||||
}
|
||||
|
||||
// only certain HOSTS can build certain TARGET_OS such as
|
||||
// windows targets must be built on windows
|
||||
// ios and macos must be built on macos
|
||||
// android or linux can be built on macos or linux
|
||||
pub fn verify_webrtc_target() -> anyhow::Result<()> {
|
||||
if !SUPPORTED_OS_TO_TARGET_ARCH.contains_key(TARGET_OS.as_str()) {
|
||||
bail!("Unsupported target OS: {}", *TARGET_OS);
|
||||
}
|
||||
if !SUPPORTED_OS_TO_TARGET_ARCH[TARGET_OS.as_str()].contains(TARGET_ARCH.as_str()) {
|
||||
bail!("Unsupported target ARCH: {}", *TARGET_ARCH);
|
||||
}
|
||||
if TARGET_SIMULATOR && !*IS_DESKTOP {
|
||||
bail!("Unsupported target OS for simulator: {}", *TARGET_OS);
|
||||
}
|
||||
|
||||
let target_os = TARGET_OS.as_str();
|
||||
let host_os = std::env::consts::OS;
|
||||
let host_os_can_build_target = match target_os {
|
||||
"windows" => host_os == "windows",
|
||||
"ios" | "macos" => ["macos"].contains(&host_os),
|
||||
"android" | "linux" => ["macos", "linux"].contains(&host_os),
|
||||
_ => bail!("Should have been prevented in earlier supported OS check"),
|
||||
};
|
||||
|
||||
if !host_os_can_build_target {
|
||||
bail!("Invalid host_os {host_os} for building target_os {target_os}")
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn shell<T: AsRef<str>>(cwd: T) -> Shell {
|
||||
let sh = Shell::new().unwrap();
|
||||
sh.change_dir(cwd.as_ref());
|
||||
sh
|
||||
}
|
||||
|
||||
pub mod config {
|
||||
use std::{
|
||||
collections::{HashMap, HashSet},
|
||||
env,
|
||||
io::BufReader,
|
||||
sync::LazyLock,
|
||||
};
|
||||
|
||||
use serde_json::Value;
|
||||
|
||||
// Build Target info
|
||||
pub static VERBOSE: LazyLock<bool> = LazyLock::new(|| env::var("CARGO_TERM_VERBOSE").is_ok());
|
||||
pub static PROFILE: LazyLock<String> = LazyLock::new(|| env::var("PROFILE").unwrap());
|
||||
pub static TARGET_OS: LazyLock<String> =
|
||||
LazyLock::new(|| env::var("CARGO_CFG_TARGET_OS").unwrap());
|
||||
pub static TARGET_ARCH: LazyLock<String> =
|
||||
LazyLock::new(|| env::var("CARGO_CFG_TARGET_ARCH").unwrap());
|
||||
pub static TARGET_SIMULATOR: bool = cfg!(feature = "simulator");
|
||||
pub static TARGET_PLATFORM: LazyLock<&str> = LazyLock::new(|| match TARGET_OS.as_str() {
|
||||
"ios" => "ios",
|
||||
"android" => "ios",
|
||||
"windows" | "macos" | "linux" => "desktop",
|
||||
_ => panic!("Unsupported TARGET OS"),
|
||||
});
|
||||
// we can simplify if we use cargo target key for webrtc artifacts
|
||||
pub static TARGET_PAIR: LazyLock<String> = LazyLock::new(|| match TARGET_OS.as_ref() {
|
||||
os @ "ios" | os @ "android" => os.to_string(),
|
||||
os => {
|
||||
// remove once we migrate releasing prebuilds using cargo build
|
||||
let os = if os == "macos" { "mac" } else { os };
|
||||
format!(
|
||||
"{}-{}",
|
||||
os,
|
||||
DESKTOP_TARGET_ARCH_TO_GNU_ARCH[TARGET_ARCH.as_str()],
|
||||
)
|
||||
}
|
||||
});
|
||||
pub static TARGET_KEY: LazyLock<String> = LazyLock::new(|| {
|
||||
if TARGET_SIMULATOR {
|
||||
format!("{}-sim", *TARGET_PAIR)
|
||||
} else {
|
||||
TARGET_PAIR.clone()
|
||||
}
|
||||
});
|
||||
pub static RINGRTC_VERSION: LazyLock<String> = LazyLock::new(|| {
|
||||
format!(
|
||||
"{}.{}.{}",
|
||||
env::var("CARGO_PKG_VERSION_MAJOR").unwrap(),
|
||||
env::var("CARGO_PKG_VERSION_MINOR").unwrap(),
|
||||
env::var("CARGO_PKG_VERSION_PATCH").unwrap()
|
||||
)
|
||||
});
|
||||
pub static IS_DESKTOP: LazyLock<bool> =
|
||||
LazyLock::new(|| ["linux", "macos", "windows"].contains(&TARGET_OS.as_str()));
|
||||
pub static IS_RELEASE: LazyLock<bool> = LazyLock::new(|| &*PROFILE == "release");
|
||||
pub static IS_TEST: bool = cfg!(test);
|
||||
|
||||
// Directory info
|
||||
pub static WORKSPACE_DIR: LazyLock<String> = LazyLock::new(|| {
|
||||
env::var("CARGO_WORKSPACE_DIR")
|
||||
.map(|s| s.strip_suffix(|_| true).unwrap_or(&s).to_string())
|
||||
.unwrap()
|
||||
});
|
||||
pub static CRATE_DIR: LazyLock<String> =
|
||||
LazyLock::new(|| format!("{}/webrtc-sys", *WORKSPACE_DIR));
|
||||
pub static LIBWEBRTC_DIR: LazyLock<String> =
|
||||
LazyLock::new(|| format!("{}/libwebrtc", *CRATE_DIR));
|
||||
pub static OUTPUT_DIR: LazyLock<String> =
|
||||
LazyLock::new(|| env::var("OUTPUT_DIR").unwrap_or(format!("{}/out", *CRATE_DIR)));
|
||||
pub static WEBRTC_DEST_DIR: LazyLock<String> = LazyLock::new(|| {
|
||||
if *IS_DESKTOP {
|
||||
format!("{}/{}/{}/obj", *OUTPUT_DIR, *TARGET_KEY, *PROFILE)
|
||||
} else {
|
||||
format!("{}/{}/{}/obj", *OUTPUT_DIR, *TARGET_OS, *PROFILE)
|
||||
}
|
||||
});
|
||||
|
||||
pub const SUPPORTED_DESKTOP_TARGET_ARCH: [&str; 4] = ["x86_64", "i686", "aarch64", "arm64"];
|
||||
pub const SUPPORTED_ANDROID_TARGET_ARCH: [&str; 5] = ["aarch64", "arm", "arm64", "x86", "x64"];
|
||||
pub const SUPPORTED_IOS_TARGET_ARCH: [&str; 3] = ["aarch64", "x86", "arm64"];
|
||||
pub static SUPPORTED_OS_TO_TARGET_ARCH: LazyLock<HashMap<&str, HashSet<&str>>> =
|
||||
LazyLock::new(|| {
|
||||
HashMap::from([
|
||||
("android", HashSet::from(SUPPORTED_ANDROID_TARGET_ARCH)),
|
||||
("ios", HashSet::from(SUPPORTED_IOS_TARGET_ARCH)),
|
||||
("macos", HashSet::from(SUPPORTED_DESKTOP_TARGET_ARCH)),
|
||||
("windows", HashSet::from(SUPPORTED_DESKTOP_TARGET_ARCH)),
|
||||
("linux", HashSet::from(SUPPORTED_DESKTOP_TARGET_ARCH)),
|
||||
])
|
||||
});
|
||||
pub static DESKTOP_TARGET_ARCH_TO_GNU_ARCH: LazyLock<HashMap<&str, &str>> =
|
||||
LazyLock::new(|| {
|
||||
HashMap::from([
|
||||
("x86_64", "x64"),
|
||||
("i686", "x86"),
|
||||
("aarch64", "arm64"),
|
||||
("arm64", "arm64"),
|
||||
])
|
||||
});
|
||||
pub static ANDROID_TARGET_ARCH_TO_GNU_ARCH: LazyLock<HashMap<&str, &str>> =
|
||||
LazyLock::new(|| {
|
||||
HashMap::from([("x86_64", "x64"), ("aarch64", "arm64"), ("armv7", "arm")])
|
||||
});
|
||||
|
||||
// Values pulled from config files
|
||||
pub static ARTIFACT_CHECKSUMS: LazyLock<Value> = LazyLock::new(|| {
|
||||
serde_json::from_str(include_str!(
|
||||
"../../../config/webrtc_artifact_checksums.json"
|
||||
))
|
||||
.expect("artifact checksums should be valid json file")
|
||||
});
|
||||
pub static VERSION_PROPERTIES: LazyLock<HashMap<String, String>> = LazyLock::new(|| {
|
||||
java_properties::read(BufReader::new(
|
||||
include_str!("../../../config/version.properties").as_bytes(),
|
||||
))
|
||||
.expect("invalid webrtc version properties file")
|
||||
});
|
||||
pub static WEBRTC_VERSION: LazyLock<&String> = LazyLock::new(|| {
|
||||
VERSION_PROPERTIES
|
||||
.get("webrtc.version")
|
||||
.expect("no webrtc.version property in versions property file")
|
||||
});
|
||||
pub static GCLIENT_FILE: LazyLock<&str> = LazyLock::new(|| match TARGET_OS.as_str() {
|
||||
"windows" => ".gclient.windows",
|
||||
"ios" | "macos" => ".gclient.apple",
|
||||
"android" | "linux" => ".gclient.unix",
|
||||
_ => panic!("Invalid target os gclient file specified"),
|
||||
});
|
||||
}
|
||||
14
webrtc-sys/libwebrtc/.gclient.apple
Normal file
14
webrtc-sys/libwebrtc/.gclient.apple
Normal file
@ -0,0 +1,14 @@
|
||||
#
|
||||
# Copyright 2019-2021 Signal Messenger, LLC
|
||||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
#
|
||||
|
||||
solutions = [
|
||||
{ "name" : "src",
|
||||
"url" : "https://github.com/signalapp/webrtc.git",
|
||||
"deps_file" : "DEPS",
|
||||
},
|
||||
]
|
||||
|
||||
target_os = ["ios", "mac"]
|
||||
|
||||
14
webrtc-sys/libwebrtc/.gclient.unix
Normal file
14
webrtc-sys/libwebrtc/.gclient.unix
Normal file
@ -0,0 +1,14 @@
|
||||
#
|
||||
# Copyright 2019-2021 Signal Messenger, LLC
|
||||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
#
|
||||
|
||||
solutions = [
|
||||
{ "name" : "src",
|
||||
"url" : "https://github.com/signalapp/webrtc.git",
|
||||
"deps_file" : "DEPS",
|
||||
},
|
||||
]
|
||||
|
||||
target_os = ["android", "linux"]
|
||||
|
||||
14
webrtc-sys/libwebrtc/.gclient.windows
Normal file
14
webrtc-sys/libwebrtc/.gclient.windows
Normal file
@ -0,0 +1,14 @@
|
||||
#
|
||||
# Copyright 2019-2021 Signal Messenger, LLC
|
||||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
#
|
||||
|
||||
solutions = [
|
||||
{ "name" : "src",
|
||||
"url" : "https://github.com/signalapp/webrtc.git",
|
||||
"deps_file" : "DEPS",
|
||||
},
|
||||
]
|
||||
|
||||
target_os = ["windows"]
|
||||
|
||||
5
webrtc-sys/libwebrtc/.gitignore
vendored
Normal file
5
webrtc-sys/libwebrtc/.gitignore
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
.cipd
|
||||
.gclient*_entries
|
||||
.gclient_previous_sync_commits
|
||||
.gcs_entries
|
||||
src
|
||||
1
webrtc-sys/src/lib.rs
Normal file
1
webrtc-sys/src/lib.rs
Normal file
@ -0,0 +1 @@
|
||||
|
||||
Loading…
Reference in New Issue
Block a user