feat(clients): in-app OSS / third-party-license screens
Surface THIRD-PARTY-NOTICES.txt in every GUI client (the desktop packages already
ship it as a file; this adds the on-glass screen):
- Linux: Preferences -> About -> Third-party licenses (adw::AboutDialog with the app
license + Legal sections; include_str! the root notices).
- Apple: macOS About tab / iOS+tvOS Acknowledgements link; notices bundled as
PunktfunkKit SPM resources, read via Bundle.module (the Xcode app links the SPM
product, so they ride along - no .pbxproj edit).
- Android: Settings -> About -> Open-source licenses (reads the bundled asset).
- (Windows landed earlier in d1d2ca2: Settings -> About -> Third-party licenses.)
gen-third-party-notices.sh now copies the generated file into the Apple Resources/
and Android assets/ trees so the in-tree copies never drift.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -19,6 +19,49 @@ const REFRESH: &[u32] = &[0, 30, 60, 90, 120, 144, 165, 240];
|
||||
const GAMEPADS: &[&str] = &["auto", "xbox360", "dualsense", "xboxone", "dualshock4"];
|
||||
const COMPOSITORS: &[&str] = &["auto", "kwin", "wlroots", "mutter", "gamescope"];
|
||||
|
||||
/// punktfunk's own license (MIT OR Apache-2.0), shown on the About dialog's Legal page.
|
||||
const APP_LICENSE: &str = concat!(
|
||||
"punktfunk is licensed under MIT OR Apache-2.0, at your option.\n\n",
|
||||
"================================ MIT ================================\n\n",
|
||||
include_str!("../../../LICENSE-MIT"),
|
||||
"\n\n=============================== Apache-2.0 ===============================\n\n",
|
||||
include_str!("../../../LICENSE-APACHE"),
|
||||
);
|
||||
/// Third-party software notices for the linked Rust crates (generated by
|
||||
/// scripts/gen-third-party-notices.sh; shown as a Legal section in the About dialog).
|
||||
const THIRD_PARTY_NOTICES: &str = include_str!("../../../THIRD-PARTY-NOTICES.txt");
|
||||
|
||||
/// Show the About dialog (app license + the third-party-software Legal section).
|
||||
fn show_about(parent: &impl IsA<gtk::Widget>) {
|
||||
let about = adw::AboutDialog::builder()
|
||||
.application_name("punktfunk")
|
||||
.developer_name("unom")
|
||||
.version(env!("CARGO_PKG_VERSION"))
|
||||
.website("https://git.unom.io/unom/punktfunk")
|
||||
.license_type(gtk::License::Custom)
|
||||
.license(APP_LICENSE)
|
||||
.build();
|
||||
// The native (FFmpeg/GTK/PipeWire/SDL3) components are dynamically linked under their own
|
||||
// (LGPL/Zlib/MIT) licenses; the Rust crate notices are the substantive attribution set.
|
||||
about.add_legal_section(
|
||||
"Third-party software (Rust crates)",
|
||||
None,
|
||||
gtk::License::Custom,
|
||||
Some(THIRD_PARTY_NOTICES),
|
||||
);
|
||||
about.add_legal_section(
|
||||
"Third-party software (system libraries)",
|
||||
None,
|
||||
gtk::License::Custom,
|
||||
Some(
|
||||
"This application dynamically links system libraries under their own licenses, \
|
||||
including FFmpeg (LGPL v2.1+), GTK 4 and libadwaita (LGPL v2.1+), PipeWire (MIT), \
|
||||
and SDL 3 (Zlib). Their full license texts are available from each project.",
|
||||
),
|
||||
);
|
||||
about.present(Some(parent));
|
||||
}
|
||||
|
||||
pub fn show(
|
||||
parent: &impl IsA<gtk::Widget>,
|
||||
settings: Rc<RefCell<Settings>>,
|
||||
@@ -156,9 +199,23 @@ pub fn show(
|
||||
.build();
|
||||
audio.add(&mic_row);
|
||||
|
||||
let about = adw::PreferencesGroup::builder().title("About").build();
|
||||
let licenses_row = adw::ActionRow::builder()
|
||||
.title("Third-party licenses")
|
||||
.subtitle("Open-source software used by punktfunk")
|
||||
.activatable(true)
|
||||
.build();
|
||||
licenses_row.add_suffix(>k::Image::from_icon_name("go-next-symbolic"));
|
||||
{
|
||||
let about_parent: gtk::Widget = parent.clone().upcast();
|
||||
licenses_row.connect_activated(move |_| show_about(&about_parent));
|
||||
}
|
||||
about.add(&licenses_row);
|
||||
|
||||
page.add(&stream);
|
||||
page.add(&input);
|
||||
page.add(&audio);
|
||||
page.add(&about);
|
||||
|
||||
// Seed from the current settings.
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user