nixpkgs/pkgs/applications/audio/psst/make-build-reproducible.patch

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

65 lines
2.2 KiB
Diff
Raw Normal View History

2023-05-13 21:27:05 +00:00
diff --git a/psst-core/build.rs b/psst-core/build.rs
deleted file mode 100644
2024-10-16 00:30:30 +00:00
index cac2c23..0000000
2023-05-13 21:27:05 +00:00
--- a/psst-core/build.rs
+++ /dev/null
2024-10-16 00:30:30 +00:00
@@ -1,41 +0,0 @@
2023-05-13 21:27:05 +00:00
-use std::{env, fs, io::Write};
-
-fn main() {
- let outdir = env::var("OUT_DIR").unwrap();
- let outfile = format!("{}/build-time.txt", outdir);
-
- let mut fh = fs::File::create(outfile).unwrap();
- write!(fh, r#""{}""#, chrono::Local::now()).ok();
-
2024-10-16 00:30:30 +00:00
- let git_config =
- gix_config::File::from_git_dir("../.git/".into()).expect("Git Config not found!");
2023-05-13 21:27:05 +00:00
- // Get Git's 'Origin' URL
- let mut remote_url = git_config
2024-10-16 00:30:30 +00:00
- .raw_value("remote.origin.url")
2023-05-13 21:27:05 +00:00
- .expect("Couldn't extract origin url!")
- .to_string();
2024-10-16 00:30:30 +00:00
-
2023-05-13 21:27:05 +00:00
- // Check whether origin is accessed via ssh
- if remote_url.contains('@') {
- // If yes, strip the `git@` prefix and split the domain and path
- let mut split = remote_url
- .strip_prefix("git@")
- .unwrap_or(&remote_url)
- .split(':');
- let domain = split
- .next()
- .expect("Couldn't extract domain from ssh-style origin");
- let path = split
- .next()
- .expect("Couldn't expect path from ssh-style origin");
-
- // And construct the http-style url
- remote_url = format!("https://{domain}/{path}");
- }
- let trimmed_url = remote_url.trim_end_matches(".git");
- remote_url.clone_from(&String::from(trimmed_url));
-
2023-05-13 21:27:05 +00:00
- let outfile = format!("{}/remote-url.txt", outdir);
- let mut file = fs::File::create(outfile).unwrap();
- write!(file, r#""{}""#, remote_url).ok();
-}
diff --git a/psst-core/src/lib.rs b/psst-core/src/lib.rs
2024-10-16 00:30:30 +00:00
index 2faa317..7d7501d 100644
2023-05-13 21:27:05 +00:00
--- a/psst-core/src/lib.rs
+++ b/psst-core/src/lib.rs
@@ -2,9 +2,9 @@
2023-05-13 21:27:05 +00:00
use git_version::git_version;
-pub const GIT_VERSION: &str = git_version!();
-pub const BUILD_TIME: &str = include!(concat!(env!("OUT_DIR"), "/build-time.txt"));
-pub const REMOTE_URL: &str = include!(concat!(env!("OUT_DIR"), "/remote-url.txt"));
2024-10-16 00:30:30 +00:00
+pub const GIT_VERSION: &str = "38d1c75d59848c54cb88896a93e05da3c71c7df4";
2023-05-13 21:27:05 +00:00
+pub const BUILD_TIME: &str = "1970-01-01 00:00:00";
+pub const REMOTE_URL: &str = "https://github.com/jpochyla/psst";
pub mod actor;
pub mod audio;