1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
|
Description: patch build.rs to allow building
This patch deletes most of build.rs to allow gir to be built.
Author: Matthias Geiger <werdahias@riseup.net>
Forwarded: not-needed
Last-Update: 2023-08-25
--- 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();
|