From a851830ab1f9b6118830fb4f138643c3102eec70 Mon Sep 17 00:00:00 2001 From: mhmdanas Date: Mon, 3 Apr 2023 01:41:40 +0100 Subject: [PATCH] New package: shotman-0.4.1 --- ...ef2107b9ad1159dca0eea5b439391f8c1d5c.patch | 51 +++++++++++++++++++ srcpkgs/shotman/template | 28 ++++++++++ 2 files changed, 79 insertions(+) create mode 100644 srcpkgs/shotman/patches/d2f7ef2107b9ad1159dca0eea5b439391f8c1d5c.patch create mode 100644 srcpkgs/shotman/template diff --git a/srcpkgs/shotman/patches/d2f7ef2107b9ad1159dca0eea5b439391f8c1d5c.patch b/srcpkgs/shotman/patches/d2f7ef2107b9ad1159dca0eea5b439391f8c1d5c.patch new file mode 100644 index 000000000000..013931adc427 --- /dev/null +++ b/srcpkgs/shotman/patches/d2f7ef2107b9ad1159dca0eea5b439391f8c1d5c.patch @@ -0,0 +1,51 @@ +From d2f7ef2107b9ad1159dca0eea5b439391f8c1d5c Mon Sep 17 00:00:00 2001 +From: Jan Beich +Date: Fri, 10 Feb 2023 20:10:05 +0100 +Subject: [PATCH] Respect SHOTMAN_VERSION as documented in README.md + +Downstream may build without Git metadata or without network access +but still store checkout version somewhere, passed via environ(7). +--- +Upstream commit: https://git.sr.ht/~whynothugo/shotman/commit/d2f7ef2107b9ad1159dca0eea5b439391f8c1d5c + + build.rs | 26 ++++++++++++++------------ + 1 file changed, 14 insertions(+), 12 deletions(-) + +diff --git a/build.rs b/build.rs +index 931f773..904d270 100644 +--- a/build.rs ++++ b/build.rs +@@ -1,16 +1,18 @@ + use std::process::Command; + fn main() { +- let version = Command::new("git") +- .args(["describe", "--tags"]) +- .output() +- .map(|o| { +- if o.status.success() { +- String::from_utf8_lossy(&o.stdout).trim().to_owned() +- } else { +- String::from("unversioned") // git exited non-zero +- } +- }) +- .unwrap_or(String::from("unknown")); // failed to run git ++ if std::env::var("SHOTMAN_VERSION").is_err() { ++ let version = Command::new("git") ++ .args(["describe", "--tags"]) ++ .output() ++ .map(|o| { ++ if o.status.success() { ++ String::from_utf8_lossy(&o.stdout).trim().to_owned() ++ } else { ++ String::from("unversioned") // git exited non-zero ++ } ++ }) ++ .unwrap_or(String::from("unknown")); // failed to run git + +- println!("cargo:rustc-env=SHOTMAN_VERSION={version}"); ++ println!("cargo:rustc-env=SHOTMAN_VERSION={version}"); ++ } + } +-- +2.38.4 + diff --git a/srcpkgs/shotman/template b/srcpkgs/shotman/template new file mode 100644 index 000000000000..839d0f592812 --- /dev/null +++ b/srcpkgs/shotman/template @@ -0,0 +1,28 @@ +# Template file for 'shotman' +pkgname=shotman +version=0.4.1 +revision=1 +build_style=cargo +build_helper="qemu" +hostmakedepends="pkg-config scdoc" +makedepends="libxkbcommon-devel" +depends="slurp" +short_desc="Uncompromising screenshot GUI for Wayland" +maintainer="Mohammed Anas " +license="ISC" +homepage="https://sr.ht/~whynothugo/shotman" +changelog="https://git.sr.ht/~whynothugo/shotman/refs" +distfiles="https://git.sr.ht/~whynothugo/shotman/archive/v${version}.tar.gz" +checksum=e9f25856b40ac21cd4e7795d175b127ec86f0b8fd81ead8772c7e610d9c0de06 + +export SHOTMAN_VERSION="v${version}" + +post_install() { + scdoc shotman.1 + vman shotman.1 + vlicense LICENCE.md + for shell in bash fish zsh; do + vtargetrun "./target/${RUST_TARGET}/release/shotman_completions" "${shell}" >"completions.${shell}" + vcompletion "completions.${shell}" "${shell}" + done +}