learn-hieroglyphs/build.rs

49 lines
1.7 KiB
Rust
Raw Normal View History

2024-04-01 23:46:13 +03:00
use dirs;
use std::process::Command;
2024-04-01 15:42:50 +03:00
fn main() {
2024-04-01 23:46:13 +03:00
let home = dirs::home_dir().unwrap().to_str().unwrap().to_string();
if cfg!(target_os = "windows") {
Command::new("mkdir")
.arg("C:/ProgramData/glib-2.0/schemas/")
.spawn()
.expect("failed to make dir for schemas!");
Command::new("cp")
.arg("resources/org.foxarmy.settings.gschema.xml")
.arg("C:/ProgramData/glib-2.0/schemas/")
.spawn()
.expect("failed to copy schema to dest. dir");
Command::new("glib-compile-schemas")
.arg("C:/ProgramData/glib-2.0/schemas/")
.spawn()
.expect("Could not compile glib schemas. Probably you don't have glib build tools on your system.");
} else {
let path = format!("{}/.local/share/glib-2.0/schemas", &home);
Command::new("mkdir")
.arg("-p")
.arg(&path)
.spawn()
.expect("failed to make dir for schemas!");
Command::new("cp")
.arg("resources/org.foxarmy.settings.gschema.xml")
.arg(&path)
.spawn()
.expect("failed to copy schema to dest. dir");
2024-05-03 18:00:03 +03:00
Command::new("glib-compile-schemas")
.arg("resources")
.spawn()
.expect("Could not compile glib schemas. Probably you don't have glib build tools on your system.");
2024-04-01 23:46:13 +03:00
Command::new("glib-compile-schemas")
.arg(path)
.spawn()
.expect("Could not compile glib schemas. Probably you don't have glib build tools on your system.");
};
2024-04-01 15:42:50 +03:00
glib_build_tools::compile_resources(
&["resources"],
"resources/resources.gresource.xml",
"compiled.gresource",
);
}