psst: 2022-10-13 -> 2023-05-13

This commit is contained in:
Bruno BELANYI 2023-05-13 22:27:05 +01:00 committed by Peter Hoeg
parent cff89b3bff
commit 6250f8607c
3 changed files with 1476 additions and 806 deletions

File diff suppressed because it is too large Load diff

View file

@ -16,22 +16,21 @@ let
in
rustPlatform.buildRustPackage rec {
pname = "psst";
version = "unstable-2022-10-13";
version = "unstable-2023-05-13";
src = fetchFromGitHub {
owner = "jpochyla";
repo = pname;
rev = "d70ed8104533dc15bc36b989ba8428872c9b578f";
hash = "sha256-ZKhHN0ruLb6ZVKkrKv/YawRsVop6SP1QF/nrtkmA8P8=";
rev = "f94af14aa9fdd3d59cd92849fa7f076103b37a70";
hash = "sha256-Cmpdyec1xe7j10LDm+iCaKlBICHkmmbhKz2nDeOFOF8=";
};
cargoLock = {
lockFile = ./Cargo.lock;
outputHashes = {
"cubeb-0.10.1" = "sha256-PRQL8dq5BAsodbVlm5SnuzUDLg9/UY3BmoumcmWF+aY=";
"druid-0.7.0" = "sha256-fnsm+KGsuePLRRjTecJ0GBQEySSeDIth13AX/aAigqU=";
"druid-enums-0.1.0" = "sha256-4fo0ywoK+m4OuqYlbNbJS2BZK/VBFqeAYEFNGnGUVmM=";
"piet-0.5.0" = "sha256-hCg8vABnLAO8egFwMtRSpRdzH6auETrICoUfuBZVzz8=";
"cubeb-0.10.3" = "sha256-3eHW+kIJydF6nF0EkB/vglOvksfol+xIKoqFsKg3omI=";
"druid-0.8.3" = "sha256-hTB9PQf2TAhcLr64VjjQIr18mczwcNogDSRSN5dQULA=";
"druid-enums-0.1.0" = "sha256-KJvAgKxicx/g+4QRZq3iHt6MGVQbfOpyN+EhS6CyDZk=";
};
};
# specify the subdirectory of the binary crate to build from the workspace
@ -50,6 +49,11 @@ rustPlatform.buildRustPackage rec {
pango
];
patches = [
# Use a fixed build time, hard-code upstream URL instead of trying to read `.git`
./make-build-reproducible.patch
];
postInstall = ''
install -Dm444 psst-gui/assets/logo_512.png $out/share/icons/hicolor/512x512/apps/${pname}.png
install -Dm444 -t $out/share/applications ${desktopItem}/share/applications/*

View file

@ -0,0 +1,59 @@
diff --git a/psst-core/build.rs b/psst-core/build.rs
deleted file mode 100644
index 1057827..0000000
--- a/psst-core/build.rs
+++ /dev/null
@@ -1,37 +0,0 @@
-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();
-
- let git_config = gix_config::File::from_git_dir("../.git/").expect("Git Config not found!");
- // Get Git's 'Origin' URL
- let mut remote_url = git_config
- .raw_value("remote", Some("origin".as_ref()), "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}");
- }
- remote_url = remote_url.trim_end_matches(".git").to_owned();
- 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 fcbd491..2d71ee3 100644
--- a/psst-core/src/lib.rs
+++ b/psst-core/src/lib.rs
@@ -3,8 +3,8 @@
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 = "f94af14aa9fdd3d59cd92849fa7f076103b37a70";
+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;