Third-party notices: cargo-about config, generator, embedded text
about.toml mirrors deny.toml's allowed licenses and limits the graph to the shipped targets (Linux, Windows, Android) without build and dev dependencies. Clarifications pin the license files cargo-about misses or mangles: Slint's LicenseRef text, the bundled libopus, AWS-LC's combined notice and OpenH264's single license. about.hbs adds the Slint, OpenH264, tsclientlib and libvpx notices by hand. scripts/notices.sh regenerates THIRD_PARTY_NOTICES.md with a pinned cargo-about (0.9.2) and fails on any warning; --check diffs against the committed file. tsc_platform::notices::text() embeds it for the About page. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
This commit is contained in:
6 files changed
+12028
No files matched your search
+11591
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,156 @@
|
||||
# Third-party notices
|
||||
|
||||
<!-- Generated by scripts/notices.sh (cargo-about, about.toml, about.hbs) from
|
||||
Cargo.lock. Do not edit; regenerate after changing dependencies. -->
|
||||
|
||||
This app is licensed under MIT OR Apache-2.0. It contains the third-party
|
||||
software listed here, whose licenses require these notices.
|
||||
|
||||
## Slint
|
||||
|
||||
The user interface is built with Slint (https://slint.dev), used under the
|
||||
Slint Royalty-free Desktop, Mobile, and Web Applications License 2.0
|
||||
(LicenseRef-Slint-Royalty-free-2.0, full text below). As that license requires,
|
||||
the About page shows the AboutSlint widget.
|
||||
|
||||
## OpenH264
|
||||
|
||||
OpenH264 Video Codec provided by Cisco Systems, Inc.
|
||||
|
||||
The app does not include OpenH264. Only when you enable H.264 does it download
|
||||
Cisco's prebuilt OpenH264 binary from ciscobinary.openh264.org, check it
|
||||
against known checksums and load it at runtime; you can disable it again at
|
||||
any time. Cisco distributes that binary under the BSD-2-Clause license
|
||||
(Copyright (c) 2013, Cisco Systems; text below, used by openh264-sys2) and
|
||||
covers the MPEG LA H.264 patent royalties for it.
|
||||
|
||||
## tsclientlib
|
||||
|
||||
The TeamSpeak protocol implementation is a fork of tsclientlib
|
||||
(https://github.com/ReSpeak/tsclientlib), licensed under MIT OR Apache-2.0:
|
||||
|
||||
````text
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2017-2020 tsclientlib contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
````
|
||||
|
||||
## Native libraries
|
||||
|
||||
- Opus (libopus), compiled into the app: BSD-3-Clause, Copyright 2001-2023
|
||||
Xiph.Org and contributors; text below, used by libopus_sys.
|
||||
- AWS-LC (with code from BoringSSL and OpenSSL), compiled into the app:
|
||||
notices and texts below under ISC, used by aws-lc-sys.
|
||||
- libvpx (VP8 and VP9): the system library on Linux, compiled into the app on
|
||||
Windows. Its license and patent grant:
|
||||
|
||||
````text
|
||||
Copyright (c) 2010, The WebM Project authors. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in
|
||||
the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
|
||||
* Neither the name of Google, nor the WebM Project, nor the names
|
||||
of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written
|
||||
permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
Additional IP Rights Grant (Patents)
|
||||
------------------------------------
|
||||
|
||||
"These implementations" means the copyrightable works that implement the WebM
|
||||
codecs distributed by Google as part of the WebM Project.
|
||||
|
||||
Google hereby grants to you a perpetual, worldwide, non-exclusive, no-charge,
|
||||
royalty-free, irrevocable (except as stated in this section) patent license to
|
||||
make, have made, use, offer to sell, sell, import, transfer, and otherwise
|
||||
run, modify and propagate the contents of these implementations of WebM, where
|
||||
such license applies only to those patent claims, both currently owned by
|
||||
Google and acquired in the future, licensable by Google that are necessarily
|
||||
infringed by these implementations of WebM. This grant does not include claims
|
||||
that would be infringed only as a consequence of further modification of these
|
||||
implementations. If you or your agent or exclusive licensee institute or order
|
||||
or agree to the institution of patent litigation or any other patent
|
||||
enforcement activity against any entity (including a cross-claim or
|
||||
counterclaim in a lawsuit) alleging that any of these implementations of WebM
|
||||
or any code incorporated within any of these implementations of WebM
|
||||
constitute direct or contributory patent infringement, or inducement of
|
||||
patent infringement, then any patent rights granted to you under this License
|
||||
for these implementations of WebM shall terminate as of the date such
|
||||
litigation is filed.
|
||||
````
|
||||
|
||||
Other system libraries the app uses at runtime (ALSA, PipeWire, fontconfig,
|
||||
xkbcommon, the C and C++ runtimes) belong to the operating system and are not
|
||||
distributed with it.
|
||||
|
||||
## Rust crates
|
||||
|
||||
Licenses of the Rust crates compiled into the apps, with the crates using
|
||||
each text. Where a crate offers a choice of licenses, the one shown is the one
|
||||
this app uses. Texts marked "standard text" were not included in the crate;
|
||||
the crate's authors are listed as its copyright holders.
|
||||
|
||||
| License | Crates |
|
||||
|---|---|
|
||||
{{#each overview}}
|
||||
| {{{name}}} | {{count}} |
|
||||
{{/each}}
|
||||
{{#each licenses}}
|
||||
{{#if first_of_kind}}
|
||||
|
||||
### {{{name}}}
|
||||
{{/if}}
|
||||
|
||||
{{#if source_path}}
|
||||
Used by: {{#each used_by}}{{#unless @first}}, {{/unless}}{{{crate.name}}} {{{crate.version}}}{{/each}}
|
||||
{{else}}
|
||||
Standard text, used by:
|
||||
{{#each used_by}}
|
||||
- {{{crate.name}}} {{{crate.version}}}{{#if crate.authors}}: {{#each crate.authors}}{{#unless @first}}, {{/unless}}{{{this}}}{{/each}}{{/if}}{{#if crate.repository}} ({{{crate.repository}}}){{/if}}
|
||||
{{/each}}
|
||||
{{/if}}
|
||||
|
||||
````text
|
||||
{{{text}}}
|
||||
````
|
||||
{{/each}}
|
||||
+185
@@ -0,0 +1,185 @@
|
||||
# cargo-about configuration for THIRD_PARTY_NOTICES.md: scripts/notices.sh
|
||||
# renders about.hbs with it (see docs/release.md). Reference:
|
||||
# https://embarkstudios.github.io/cargo-about/cli/generate/config.html
|
||||
#
|
||||
# The accepted licenses are deny.toml's `[licenses] allow` list; their order is
|
||||
# the preference when a crate offers a choice ("MIT OR Apache-2.0" shows MIT).
|
||||
|
||||
accepted = [
|
||||
"MIT",
|
||||
"Apache-2.0",
|
||||
"Apache-2.0 WITH LLVM-exception",
|
||||
"BSD-2-Clause",
|
||||
"BSD-3-Clause",
|
||||
"ISC",
|
||||
"Zlib",
|
||||
"Unicode-3.0",
|
||||
"CDLA-Permissive-2.0",
|
||||
"MPL-2.0",
|
||||
"BSL-1.0",
|
||||
"Unlicense",
|
||||
# Slint: GPL-3.0-only OR royalty-free OR commercial. We use the royalty-free
|
||||
# license, which requires the AboutSlint widget in the About page.
|
||||
"LicenseRef-Slint-Royalty-free-2.0",
|
||||
# libbz2-rs-sys (unpacks Cisco's OpenH264 download in tsc-media).
|
||||
"bzip2-1.0.6",
|
||||
]
|
||||
|
||||
# What the apps ship on: the desktop app on Linux (x86_64, and aarch64 for
|
||||
# Flathub) and Windows, and the Android app. Crates used only on other
|
||||
# platforms (macOS, iOS, wasm) are left out.
|
||||
targets = [
|
||||
"x86_64-unknown-linux-gnu",
|
||||
"aarch64-unknown-linux-gnu",
|
||||
"x86_64-pc-windows-msvc",
|
||||
"aarch64-linux-android",
|
||||
"armv7-linux-androideabi",
|
||||
"x86_64-linux-android",
|
||||
]
|
||||
|
||||
# Build tools (cc, cmake, bindgen, slint-build) and test-only crates are not
|
||||
# part of any binary we distribute.
|
||||
ignore-build-dependencies = true
|
||||
ignore-dev-dependencies = true
|
||||
|
||||
# Our own crates (publish = false). The vendored tsclientlib crates in
|
||||
# crates/proto are credited in about.hbs instead.
|
||||
private = { ignore = true }
|
||||
|
||||
workarounds = ["chrono", "ring", "rustls"]
|
||||
|
||||
# Crate specific configuration must come last.
|
||||
#
|
||||
# Clarifications replace the license files cargo-about would find; each file
|
||||
# is pinned by its SHA-256, so a changed text fails generation and gets
|
||||
# reviewed. After a dependency update: `sha256sum <file>` in the new crate
|
||||
# version (~/.cargo/registry/src/*/<crate>-<version>/).
|
||||
|
||||
# libopus_sys compiles the bundled libopus (opus/, BSD-3-Clause) into the app.
|
||||
# The crate itself is MIT; LICENSE-old is the ISC license of the code it was
|
||||
# derived from (audiopus_sys).
|
||||
[libopus_sys.clarify]
|
||||
license = "MIT AND ISC AND BSD-3-Clause"
|
||||
[[libopus_sys.clarify.files]]
|
||||
path = "LICENSE"
|
||||
license = "MIT"
|
||||
checksum = "c5512e4899a9b06c3a286bf69444ebc5314d506e437c334bfd66a2eac7bca3ef"
|
||||
[[libopus_sys.clarify.files]]
|
||||
path = "LICENSE-old"
|
||||
license = "ISC"
|
||||
checksum = "a6c8bb45880edc99bb13feb04d69fb2f0f73b565dfe209affa60414d2aa4c1a7"
|
||||
[[libopus_sys.clarify.files]]
|
||||
path = "opus/COPYING"
|
||||
license = "BSD-3-Clause"
|
||||
checksum = "01e1167d54a096d123cf6dfbbeb19587278845c6481d2d66d545669846079551"
|
||||
|
||||
# Only the bindings are compiled (tsc-media loads Cisco's binary at runtime),
|
||||
# but without this every header of the vendored OpenH264 sources would be
|
||||
# listed. upstream/LICENSE is also the license of Cisco's binary.
|
||||
[openh264-sys2.clarify]
|
||||
license = "BSD-2-Clause"
|
||||
[[openh264-sys2.clarify.files]]
|
||||
path = "upstream/LICENSE"
|
||||
checksum = "dd5c1c9668512530fa5a96e4c29ac4033d70a7eeb0eed7a42fddb6dd794ebdbb"
|
||||
|
||||
# AWS-LC (DTLS for WebRTC through str0m): LICENSE holds the attributions of
|
||||
# BoringSSL, OpenSSL and the bundled third-party code plus all license texts.
|
||||
# It is shown once, under ISC; the other licenses of the expression get their
|
||||
# standard texts.
|
||||
[aws-lc-sys.clarify]
|
||||
license = "ISC AND (Apache-2.0 OR ISC) AND Apache-2.0 AND MIT AND BSD-3-Clause AND (Apache-2.0 OR ISC OR MIT) AND (Apache-2.0 OR ISC OR MIT-0)"
|
||||
[[aws-lc-sys.clarify.files]]
|
||||
path = "LICENSE"
|
||||
license = "ISC"
|
||||
checksum = "728536b4160e051f86d7c9c388f704866b3d512cd7df97ac3516c65279523c4e"
|
||||
|
||||
# Slint keeps its license texts in LICENSES/, which cargo-about does not match
|
||||
# to the LicenseRef without a clarification. cargo-about 0.9.2 skips clarified
|
||||
# files whose `license` names the LicenseRef they are the text of (an inverted
|
||||
# check in generate.rs), so the file is tagged with a distinct LicenseRef; the
|
||||
# text is still shown under LicenseRef-Slint-Royalty-free-2.0. Revisit when
|
||||
# updating cargo-about (scripts/notices.sh fails if the text goes missing).
|
||||
[slint.clarify]
|
||||
license = "GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0"
|
||||
[[slint.clarify.files]]
|
||||
path = "LICENSES/LicenseRef-Slint-Royalty-free-2.0.md"
|
||||
license = "LicenseRef-Slint-Royalty-free-2.0-text"
|
||||
checksum = "5167f5056e850419106ab6265efbdca7cba4d99c849d1445ca0bbf6a1e2315fe"
|
||||
|
||||
[slint-macros.clarify]
|
||||
license = "GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0"
|
||||
[[slint-macros.clarify.files]]
|
||||
path = "LICENSES/LicenseRef-Slint-Royalty-free-2.0.md"
|
||||
license = "LicenseRef-Slint-Royalty-free-2.0-text"
|
||||
checksum = "5167f5056e850419106ab6265efbdca7cba4d99c849d1445ca0bbf6a1e2315fe"
|
||||
|
||||
[i-slint-common.clarify]
|
||||
license = "GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0"
|
||||
[[i-slint-common.clarify.files]]
|
||||
path = "LICENSES/LicenseRef-Slint-Royalty-free-2.0.md"
|
||||
license = "LicenseRef-Slint-Royalty-free-2.0-text"
|
||||
checksum = "5167f5056e850419106ab6265efbdca7cba4d99c849d1445ca0bbf6a1e2315fe"
|
||||
|
||||
[i-slint-compiler.clarify]
|
||||
license = "GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0"
|
||||
[[i-slint-compiler.clarify.files]]
|
||||
path = "LICENSES/LicenseRef-Slint-Royalty-free-2.0.md"
|
||||
license = "LicenseRef-Slint-Royalty-free-2.0-text"
|
||||
checksum = "5167f5056e850419106ab6265efbdca7cba4d99c849d1445ca0bbf6a1e2315fe"
|
||||
|
||||
[i-slint-core.clarify]
|
||||
license = "GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0"
|
||||
[[i-slint-core.clarify.files]]
|
||||
path = "LICENSES/LicenseRef-Slint-Royalty-free-2.0.md"
|
||||
license = "LicenseRef-Slint-Royalty-free-2.0-text"
|
||||
checksum = "5167f5056e850419106ab6265efbdca7cba4d99c849d1445ca0bbf6a1e2315fe"
|
||||
|
||||
[i-slint-core-macros.clarify]
|
||||
license = "GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0"
|
||||
[[i-slint-core-macros.clarify.files]]
|
||||
path = "LICENSES/LicenseRef-Slint-Royalty-free-2.0.md"
|
||||
license = "LicenseRef-Slint-Royalty-free-2.0-text"
|
||||
checksum = "5167f5056e850419106ab6265efbdca7cba4d99c849d1445ca0bbf6a1e2315fe"
|
||||
|
||||
[i-slint-backend-selector.clarify]
|
||||
license = "GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0"
|
||||
[[i-slint-backend-selector.clarify.files]]
|
||||
path = "LICENSES/LicenseRef-Slint-Royalty-free-2.0.md"
|
||||
license = "LicenseRef-Slint-Royalty-free-2.0-text"
|
||||
checksum = "5167f5056e850419106ab6265efbdca7cba4d99c849d1445ca0bbf6a1e2315fe"
|
||||
|
||||
[i-slint-backend-winit.clarify]
|
||||
license = "GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0"
|
||||
[[i-slint-backend-winit.clarify.files]]
|
||||
path = "LICENSES/LicenseRef-Slint-Royalty-free-2.0.md"
|
||||
license = "LicenseRef-Slint-Royalty-free-2.0-text"
|
||||
checksum = "5167f5056e850419106ab6265efbdca7cba4d99c849d1445ca0bbf6a1e2315fe"
|
||||
|
||||
# Android (tsc-android).
|
||||
[i-slint-backend-android-activity.clarify]
|
||||
license = "GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0"
|
||||
[[i-slint-backend-android-activity.clarify.files]]
|
||||
path = "LICENSES/LicenseRef-Slint-Royalty-free-2.0.md"
|
||||
license = "LicenseRef-Slint-Royalty-free-2.0-text"
|
||||
checksum = "5167f5056e850419106ab6265efbdca7cba4d99c849d1445ca0bbf6a1e2315fe"
|
||||
|
||||
[i-slint-renderer-software.clarify]
|
||||
license = "GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0"
|
||||
[[i-slint-renderer-software.clarify.files]]
|
||||
path = "LICENSES/LicenseRef-Slint-Royalty-free-2.0.md"
|
||||
license = "LicenseRef-Slint-Royalty-free-2.0-text"
|
||||
checksum = "5167f5056e850419106ab6265efbdca7cba4d99c849d1445ca0bbf6a1e2315fe"
|
||||
|
||||
[i-slint-renderer-femtovg.clarify]
|
||||
license = "GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0"
|
||||
[[i-slint-renderer-femtovg.clarify.files]]
|
||||
path = "LICENSES/LicenseRef-Slint-Royalty-free-2.0.md"
|
||||
license = "LicenseRef-Slint-Royalty-free-2.0-text"
|
||||
checksum = "5167f5056e850419106ab6265efbdca7cba4d99c849d1445ca0bbf6a1e2315fe"
|
||||
|
||||
[i-slint-renderer-skia.clarify]
|
||||
license = "GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0"
|
||||
[[i-slint-renderer-skia.clarify.files]]
|
||||
path = "LICENSES/LicenseRef-Slint-Royalty-free-2.0.md"
|
||||
license = "LicenseRef-Slint-Royalty-free-2.0-text"
|
||||
checksum = "5167f5056e850419106ab6265efbdca7cba4d99c849d1445ca0bbf6a1e2315fe"
|
||||
@@ -5,8 +5,10 @@
|
||||
//! Windows)
|
||||
//! - [`notify`]: desktop notifications
|
||||
//! - [`paths`]: data, config, cache and state directories
|
||||
//! - [`notices`]: third-party notices for the About page
|
||||
|
||||
pub mod hotkey;
|
||||
pub mod notices;
|
||||
pub mod notify;
|
||||
pub mod paths;
|
||||
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
//! Third-party notices for the About page.
|
||||
//!
|
||||
//! `THIRD_PARTY_NOTICES.md` at the repository root is generated from
|
||||
//! `Cargo.lock` by `scripts/notices.sh` (cargo-about) and embedded here; CI
|
||||
//! fails when it is stale. It is Markdown: an introduction (Slint, OpenH264,
|
||||
//! tsclientlib, native libraries), then each license text in a fenced block
|
||||
//! with the crates that use it. About 500 KB, so show it in a scrolling view
|
||||
//! (or write it to a file and open that), not in a single label.
|
||||
|
||||
/// The full notices, Markdown.
|
||||
pub fn text() -> &'static str {
|
||||
include_str!("../../../THIRD_PARTY_NOTICES.md")
|
||||
}
|
||||
|
||||
/// Attribution the OpenH264 license asks for wherever H.264 can be enabled
|
||||
/// (the same text as `tsc_media::codec::h264::OPENH264_ATTRIBUTION`).
|
||||
pub const OPENH264_ATTRIBUTION: &str = "OpenH264 Video Codec provided by Cisco Systems, Inc.";
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn notices_cover_required_attributions() {
|
||||
let text = text();
|
||||
assert!(text.starts_with("# Third-party notices"));
|
||||
// Slint's royalty-free license text, OpenH264 and the vendored
|
||||
// protocol library must be credited.
|
||||
assert!(text.contains("Slint Royalty-free Desktop, Mobile, and Web Applications License"));
|
||||
assert!(text.contains(OPENH264_ATTRIBUTION));
|
||||
assert!(text.contains("tsclientlib contributors"));
|
||||
// Bundled C libraries.
|
||||
assert!(text.contains("Xiph.Org"));
|
||||
assert!(text.contains("The WebM Project authors"));
|
||||
}
|
||||
}
|
||||
Executable
+58
@@ -0,0 +1,58 @@
|
||||
#!/usr/bin/env bash
|
||||
# Regenerate THIRD_PARTY_NOTICES.md from Cargo.lock with cargo-about
|
||||
# (about.toml, about.hbs). The app shows the file in its About page
|
||||
# (tsc_platform::notices::text()), so it is committed; run this after changing
|
||||
# dependencies.
|
||||
#
|
||||
# Usage: scripts/notices.sh regenerate THIRD_PARTY_NOTICES.md
|
||||
# scripts/notices.sh --check fail if the committed file is stale (CI)
|
||||
#
|
||||
# Needs cargo-about $ABOUT_VERSION; the output depends on its version:
|
||||
# cargo install cargo-about --locked --version 0.9.2 --features cli
|
||||
# Fails on any warning, e.g. a license whose text was not found.
|
||||
set -euo pipefail
|
||||
|
||||
ABOUT_VERSION=0.9.2
|
||||
OUT=THIRD_PARTY_NOTICES.md
|
||||
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
check=false
|
||||
case "${1:-}" in
|
||||
--check) check=true ;;
|
||||
"") ;;
|
||||
*) echo "usage: $0 [--check]" >&2; exit 2 ;;
|
||||
esac
|
||||
|
||||
version=$(cargo about --version 2>/dev/null | awk '{print $2}' || true)
|
||||
if [[ "$version" != "$ABOUT_VERSION" ]]; then
|
||||
echo "cargo-about $ABOUT_VERSION is required (found: ${version:-none}):" >&2
|
||||
echo " cargo install cargo-about --locked --version $ABOUT_VERSION --features cli" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
tmp=$(mktemp -d)
|
||||
trap 'rm -rf "$tmp"' EXIT
|
||||
|
||||
# Workspace members with default features, filtered by the targets in
|
||||
# about.toml, so the result does not depend on the host.
|
||||
if ! cargo about generate --workspace --locked --fail about.hbs -o "$tmp/$OUT" 2>"$tmp/log"; then
|
||||
cat "$tmp/log" >&2
|
||||
exit 1
|
||||
fi
|
||||
if grep -E "WARN|ERROR" "$tmp/log" >&2; then
|
||||
echo "cargo-about reported problems (above); fix about.toml" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if $check; then
|
||||
if ! diff -u "$OUT" "$tmp/$OUT" >"$tmp/diff"; then
|
||||
head -n 100 "$tmp/diff"
|
||||
echo "$OUT is stale: run scripts/notices.sh and commit the result" >&2
|
||||
exit 1
|
||||
fi
|
||||
echo "$OUT is up to date"
|
||||
else
|
||||
mv "$tmp/$OUT" "$OUT"
|
||||
echo "wrote $OUT ($(wc -c <"$OUT") bytes)"
|
||||
fi
|
||||
Reference in new issue
Block a user