depot/pkgs/applications/audio/psst/make-build-reproducible.patch
Luke Granger-Brown 57725ef3ec Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce
git-subtree-dir: third_party/nixpkgs
git-subtree-split: 76612b17c0ce71689921ca12d9ffdc9c23ce40b2
2024-11-10 23:59:47 +00:00

66 lines
2.3 KiB
Diff

diff --git a/psst-core/build.rs b/psst-core/build.rs
deleted file mode 100644
index 4e899af..0000000
--- a/psst-core/build.rs
+++ /dev/null
@@ -1,43 +0,0 @@
-use gix_config::File;
-use std::{env, fs, io::Write};
-use time::OffsetDateTime;
-
-fn main() {
- let outdir = env::var("OUT_DIR").unwrap();
- let outfile = format!("{}/build-time.txt", outdir);
-
- let mut fh = fs::File::create(outfile).unwrap();
- let now = OffsetDateTime::now_local().unwrap_or_else(|_| OffsetDateTime::now_utc());
- write!(fh, r#""{}""#, now).ok();
-
- let git_config = File::from_git_dir("../.git/".into()).expect("Git Config not found!");
- // Get Git's 'Origin' URL
- let mut remote_url = git_config
- .raw_value("remote.origin.url")
- .expect("Couldn't extract origin url!")
- .to_string();
-
- // 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));
-
- 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
index 2faa317..b890a2d 100644
--- a/psst-core/src/lib.rs
+++ b/psst-core/src/lib.rs
@@ -2,9 +2,9 @@
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"));
+pub const GIT_VERSION: &str = "02923198ba0e27b2b6271340cf57dd8ce109049b";
+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;