Added the supplied CCCA SVG as a square, scalable application icon. GTK embeds it for local Cargo launches, and Flatpak assets include a matching desktop entry and AppStream metadata under `at.criticalcare.SimPaM`. Added a small Flatpak asset installer and packaging instructions; the physiological simulation and audio backend are unchanged.
20 lines
1 KiB
Rust
20 lines
1 KiB
Rust
//! Embed the desktop icon for `cargo run` as well as Flatpak builds.
|
|
//! `glib-compile-resources` is provided by the GLib development tools.
|
|
use std::{env, path::PathBuf, process::Command};
|
|
|
|
fn main() {
|
|
println!("cargo:rerun-if-changed=data/simpam.gresource.xml");
|
|
println!("cargo:rerun-if-changed=data/icons/hicolor/scalable/apps/at.criticalcare.SimPaM.svg");
|
|
|
|
let source_root = PathBuf::from(env::var_os("CARGO_MANIFEST_DIR")
|
|
.expect("Cargo must provide CARGO_MANIFEST_DIR"));
|
|
let target = PathBuf::from(env::var_os("OUT_DIR")
|
|
.expect("Cargo must provide OUT_DIR")).join("simpam.gresource");
|
|
let result = Command::new("glib-compile-resources")
|
|
.arg(source_root.join("data/simpam.gresource.xml"))
|
|
.arg(format!("--sourcedir={}", source_root.join("data").display()))
|
|
.arg(format!("--target={}", target.display()))
|
|
.status()
|
|
.expect("glib-compile-resources is required (install glib2-devel on Fedora)");
|
|
assert!(result.success(), "failed to compile SimPaM icon resources");
|
|
}
|