Implement Driftwood AppImage manager
This commit is contained in:
36
build.rs
Normal file
36
build.rs
Normal file
@@ -0,0 +1,36 @@
|
||||
use std::path::PathBuf;
|
||||
use std::process::Command;
|
||||
|
||||
fn main() {
|
||||
// Compile GResources
|
||||
glib_build_tools::compile_resources(
|
||||
&["data"],
|
||||
"data/resources.gresource.xml",
|
||||
"driftwood.gresource",
|
||||
);
|
||||
|
||||
// Compile GSettings schema for development builds
|
||||
let out_dir = PathBuf::from(std::env::var("OUT_DIR").unwrap());
|
||||
let schema_dir = out_dir.join("gschemas");
|
||||
std::fs::create_dir_all(&schema_dir).expect("Failed to create schema dir");
|
||||
|
||||
std::fs::copy(
|
||||
"data/app.driftwood.Driftwood.gschema.xml",
|
||||
schema_dir.join("app.driftwood.Driftwood.gschema.xml"),
|
||||
)
|
||||
.expect("Failed to copy schema");
|
||||
|
||||
let status = Command::new("glib-compile-schemas")
|
||||
.arg(&schema_dir)
|
||||
.status()
|
||||
.expect("Failed to run glib-compile-schemas");
|
||||
|
||||
if !status.success() {
|
||||
panic!("glib-compile-schemas failed");
|
||||
}
|
||||
|
||||
println!(
|
||||
"cargo::rustc-env=GSETTINGS_SCHEMA_DIR={}",
|
||||
schema_dir.display()
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user