aboutsummaryrefslogtreecommitdiffstats
path: root/community/newsboat/fix-version-number.patch
diff options
context:
space:
mode:
Diffstat (limited to 'community/newsboat/fix-version-number.patch')
-rw-r--r--community/newsboat/fix-version-number.patch36
1 files changed, 36 insertions, 0 deletions
diff --git a/community/newsboat/fix-version-number.patch b/community/newsboat/fix-version-number.patch
new file mode 100644
index 00000000000..82d6ba16ba5
--- /dev/null
+++ b/community/newsboat/fix-version-number.patch
@@ -0,0 +1,36 @@
+fixes version string by removing git parsing as we are in a repository
+
+diff --git a/rust/libnewsboat/build.rs b/rust/libnewsboat/build.rs
+index 073b4948..9f3377f2 100644
+--- a/rust/libnewsboat/build.rs
++++ b/rust/libnewsboat/build.rs
+@@ -1,23 +1,8 @@
+-use std::process::Command;
+-
+ fn main() {
+- // Code lifted from https://stackoverflow.com/a/44407625/2350060
+- let command_output = Command::new("git")
+- .args(["describe", "--abbrev=4", "--dirty", "--always", "--tags"])
+- .output();
+- match command_output {
+- Ok(ref hash_output) if hash_output.status.success() => {
+- let hash = String::from_utf8_lossy(&hash_output.stdout);
+- println!("cargo:rustc-env=NEWSBOAT_VERSION={hash}");
+- // Re-build this crate when Git HEAD changes. Idea lifted from vergen crate.
+- println!("cargo:rebuild-if-changed=.git/HEAD");
+- }
+-
+- _ => println!(
+- "cargo:rustc-env=NEWSBOAT_VERSION={}.{}.{}",
+- env!("CARGO_PKG_VERSION_MAJOR"),
+- env!("CARGO_PKG_VERSION_MINOR"),
+- env!("CARGO_PKG_VERSION_PATCH")
+- ),
+- }
++ println!(
++ "cargo:rustc-env=NEWSBOAT_VERSION={}.{}.{}",
++ env!("CARGO_PKG_VERSION_MAJOR"),
++ env!("CARGO_PKG_VERSION_MINOR"),
++ env!("CARGO_PKG_VERSION_PATCH")
++ )
+ }