use std::path::PathBuf; fn main() { std::env::var("MESON_BUILD_ROOT").expect("build this through meson please!!"); let out_path = std::path::PathBuf::from(std::env::var("OUT_DIR").unwrap()); // compile blueprints { let mut command = std::process::Command::new("blueprint-compiler"); command .arg("batch-compile") .arg(out_path.join("resources")) .arg("resources"); for source in [ "play_queue.blp", "play_queue_song.blp", "playbar.blp", "setup.blp", "window.blp", ] { command.arg(format!("resources/{source}")); } let output = command.output().unwrap(); assert!( output.status.success(), "blueprint-compiler failed with exit status {} and stdout:\n{}", output.status, String::from_utf8_lossy(&output.stdout) ); println!("cargo::rerun-if-changed=resources"); } glib_build_tools::compile_resources( &[PathBuf::from("resources"), out_path.join("resources")], "resources/audrey.gresource.xml", "audrey.gresource", ); println!("cargo::rerun-if-changed=resources/audrey.gresource.xml"); // TODO: consider using meson to pass include paths println!("cargo::rustc-link-lib=mpv"); let bindings = bindgen::Builder::default() .header("src/mpv/wrapper.h") .parse_callbacks(Box::new(bindgen::CargoCallbacks::new())) .generate() .expect("could not generate bindings for mpv"); bindings .write_to_file(out_path.join("mpv_ffi.rs")) .expect("could not write mpv bindings"); println!("cargo::rerun-if-changed=src/mpv/wrapper.h"); }