From: Matthias Geiger Date: Thu, 18 Sep 2025 11:55:58 -0400 Subject: patch build.rs to allow building Forwarded: not-needed Last-Update: 2023-08-25 This patch deletes most of build.rs to allow gir to be built. --- build.rs | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/build.rs b/build.rs index 043c0a5..9b926f6 100644 --- a/build.rs +++ b/build.rs @@ -1,22 +1,13 @@ use std::{fs::File, io::Write}; - +use std::env; // Build.rs does not use all provided functions #[allow(dead_code)] #[path = "src/git.rs"] mod git; fn main() { - let repo_path = git::git_dir(".").unwrap(); - let head_path = repo_path.join("HEAD"); - println!("cargo:rerun-if-changed={}", head_path.display()); - let head = std::fs::read_to_string(&head_path).unwrap(); - if let Some(ref_) = head.trim_end().strip_prefix("ref: ") { - let ref_path = repo_path.join(ref_); - assert!(ref_path.is_file()); - println!("cargo:rerun-if-changed={}", ref_path.display()); - } - let ver = git::repo_hash(".").unwrap_or_else(|| "???".into()); + let ver = env!("CARGO_PKG_VERSION"); File::create("src/gir_version.rs") .and_then(|mut f| writeln!(f, "pub const VERSION: &str = \"{ver}\";",)) .unwrap();