redlib: embed Git hash

This commit is contained in:
NullBite 2024-11-19 17:47:19 -05:00
parent 444e7048f9
commit e08e916cbc
Signed by: nullbite
GPG Key ID: 6C4D545385D4925A
2 changed files with 14 additions and 0 deletions

View File

@ -22,6 +22,9 @@ rustPlatform.buildRustPackage rec {
};
patches = [
# this is so the commit hash can be embedded so redlib doesn't complain
# about the server being outdated unless it's /actually/ outdated
./no-hash.patch
];
cargoHash = "sha256-ZmIYTDfdMDkxT1doV5kMMjqIHQ/zhiY/ewd77RqRSMU=";
@ -63,6 +66,7 @@ rustPlatform.buildRustPackage rec {
env = {
SSL_CERT_FILE = "${cacert}/etc/ssl/certs/ca-bundle.crt";
GIT_HASH=src.rev;
};
passthru.tests = {

10
pkgs/redlib/no-hash.patch Normal file
View File

@ -0,0 +1,10 @@
diff --git a/build.rs b/build.rs
index 0bdbda0..869c7e6 100644
--- a/build.rs
+++ b/build.rs
@@ -21,5 +21,4 @@ fn main() {
)
.unwrap_or_default();
let git_hash = if output == String::default() { "dev".into() } else { output };
- println!("cargo:rustc-env=GIT_HASH={git_hash}");
}