Debian Codegraph @

debian/patches/patch-build-rs.diff

raw
1 From: Matthias Geiger <[email protected]>
2 Date: Thu, 18 Sep 2025 11:55:58 -0400
3 Subject: patch build.rs to allow building
4
5 Forwarded: not-needed
6 Last-Update: 2023-08-25
7
8 This patch deletes most of build.rs to allow gir to be built.
9 ---
10 build.rs | 13 ++-----------
11 1 file changed, 2 insertions(+), 11 deletions(-)
12
13 diff --git a/build.rs b/build.rs
14 index 043c0a5..9b926f6 100644
15 --- a/build.rs
16 +++ b/build.rs
17 @@ -1,22 +1,13 @@
18 use std::{fs::File, io::Write};
19 -
20 +use std::env;
21 // Build.rs does not use all provided functions
22 #[allow(dead_code)]
23 #[path = "src/git.rs"]
24 mod git;
25
26 fn main() {
27 - let repo_path = git::git_dir(".").unwrap();
28 - let head_path = repo_path.join("HEAD");
29 - println!("cargo:rerun-if-changed={}", head_path.display());
30 - let head = std::fs::read_to_string(&head_path).unwrap();
31 - if let Some(ref_) = head.trim_end().strip_prefix("ref: ") {
32 - let ref_path = repo_path.join(ref_);
33 - assert!(ref_path.is_file());
34 - println!("cargo:rerun-if-changed={}", ref_path.display());
35 - }
36 - let ver = git::repo_hash(".").unwrap_or_else(|| "???".into());
37
38 + let ver = env!("CARGO_PKG_VERSION");
39 File::create("src/gir_version.rs")
40 .and_then(|mut f| writeln!(f, "pub const VERSION: &str = \"{ver}\";",))
41 .unwrap();