x11-misc/i3status-rust: provide release hash and date without git

Fixes output of `i3status-rs -V`

Signed-off-by: Lucio Sauer <watermanpaint@posteo.net>
This commit is contained in:
Lucio Sauer
2024-07-11 13:05:13 +02:00
parent a71150e796
commit 13c4e70526
4 changed files with 56 additions and 1 deletions

View File

@@ -0,0 +1,25 @@
Statically provide the release commit hash and date by replacing the
placeholder values within the ebuild.
Author: Lucio Sauer <watermanpaint@posteo.net>
--- a/build.rs
+++ b/build.rs
@@ -1,16 +1,6 @@
-use std::process::Command;
-
fn main() {
- let hash = Command::new("git")
- .args(["rev-parse", "--short", "HEAD"])
- .env("GIT_CONFIG_GLOBAL", "/dev/null")
- .output()
- .map(|o| String::from_utf8(o.stdout).unwrap());
- let date = Command::new("git")
- .args(["log", "--pretty=format:'%ad'", "-n1", "--date=short"])
- .env("GIT_CONFIG_GLOBAL", "/dev/null")
- .output()
- .map(|o| String::from_utf8(o.stdout).unwrap());
+ let hash = String::from("%COMMIT%");
+ let date = String::from("%DATE%");
if let (Ok(hash), Ok(date)) = (hash, date) {
let ver = format!(
"{} (commit {} {})",

View File

@@ -1,4 +1,4 @@
# Copyright 2020-2023 Gentoo Authors
# Copyright 2020-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# Autogenerated by pycargoebuild 0.10
@@ -377,8 +377,18 @@ DEPEND="dev-libs/openssl:=
RDEPEND="${DEPEND}"
BDEPEND=">=virtual/rust-1.72.0"
PATCHES="${FILESDIR}"/gitless-hash-and-date.patch
QA_FLAGS_IGNORED="usr/bin/i3status-rs"
src_prepare() {
default
local COMMIT="6d936b9698902ad4bd35294cdb26147c1b23bb90"
local DATE="2023-11-22"
sed -e "s/%COMMIT%/${COMMIT:0:9}/" -e "s/%DATE%/${DATE}/" \
-i build.rs || die
}
src_configure() {
local myfeatures=(
$(usex debug debug_borders "")

View File

@@ -405,8 +405,18 @@ BDEPEND="
pipewire? ( sys-devel/clang )
"
PATCHES="${FILESDIR}"/gitless-hash-and-date.patch
QA_FLAGS_IGNORED="usr/bin/i3status-rs"
src_prepare() {
default
local COMMIT="e62d10e9ce9f6b381f6095ddc7bbf6f5a891012d"
local DATE="2024-02-19"
sed -e "s/%COMMIT%/${COMMIT:0:9}/" -e "s/%DATE%/${DATE}/" \
-i build.rs || die
}
src_configure() {
local myfeatures=(
$(usex debug debug_borders "")

View File

@@ -407,8 +407,18 @@ BDEPEND="
pipewire? ( sys-devel/clang )
"
PATCHES="${FILESDIR}"/gitless-hash-and-date.patch
QA_FLAGS_IGNORED="usr/bin/i3status-rs"
src_prepare() {
default
local COMMIT="974402d0d3cd458e9df14581d53081779fd6ef6b"
local DATE="2024-04-07"
sed -e "s/%COMMIT%/${COMMIT:0:9}/" -e "s/%DATE%/${DATE}/" \
-i build.rs || die
}
src_configure() {
local myfeatures=(
$(usev debug debug_borders)