use std::env; use std::path::Path; use std::process::Command; fn main() { println!("cargo:rerun-if-changed=data/tc.mal.lleap.gschema.xml"); compile_schemas(); bundle_icons(); } fn compile_schemas() { let out_dir = env::var("OUT_DIR").unwrap(); let schema_dir = Path::new(&out_dir).join("glib-2.0").join("schemas"); std::fs::create_dir_all(&schema_dir).unwrap(); std::fs::copy( "data/tc.mal.lleap.gschema.xml", schema_dir.join("tc.mal.lleap.gschema.xml"), ) .unwrap(); Command::new("glib-compile-schemas") .arg(&schema_dir) .output() .unwrap(); println!( "cargo:rustc-env=GSETTINGS_SCHEMA_DIR={}", schema_dir.display() ); } fn bundle_icons() { relm4_icons_build::bundle_icons( // Name of the file that will be generated at `OUT_DIR` "icon_names.rs", // Optional app ID Some("tc.mal.lleap"), // Custom base resource path: // * defaults to `/com/example/myapp` in this case if not specified explicitly // * or `/org/relm4` if app ID was not specified either None::<&str>, // Directory with custom icons (if any) None::<&str>, // List of icons to include ["settings", "play-large", "pause-large", "subtitles"], ); }