From 85aff1d28eb3b5b888affa3d8c13087b1a50896f Mon Sep 17 00:00:00 2001 From: Marcin Puc Date: Tue, 15 Mar 2022 13:25:42 +0100 Subject: [PATCH] New package: sheldon-0.6.6 --- ...l-when-building-outside-git-repo-139.patch | 41 ++++++++++++++ srcpkgs/sheldon/patches/0002-Fix-tests.patch | 56 +++++++++++++++++++ srcpkgs/sheldon/template | 38 +++++++++++++ 3 files changed, 135 insertions(+) create mode 100644 srcpkgs/sheldon/patches/0001-Fix-build-fail-when-building-outside-git-repo-139.patch create mode 100644 srcpkgs/sheldon/patches/0002-Fix-tests.patch create mode 100644 srcpkgs/sheldon/template diff --git a/srcpkgs/sheldon/patches/0001-Fix-build-fail-when-building-outside-git-repo-139.patch b/srcpkgs/sheldon/patches/0001-Fix-build-fail-when-building-outside-git-repo-139.patch new file mode 100644 index 000000000000..9674370eb425 --- /dev/null +++ b/srcpkgs/sheldon/patches/0001-Fix-build-fail-when-building-outside-git-repo-139.patch @@ -0,0 +1,41 @@ +From e2f2d86544804e656710834d359d277c07e3f232 Mon Sep 17 00:00:00 2001 +From: Marcin Puc <5671049+tranzystorek-io@users.noreply.github.com> +Date: Wed, 16 Mar 2022 07:15:48 +0100 +Subject: [PATCH] Fix build fail when building outside git repo (#139) + +--- + tests/lib.rs | 15 ++++++++++++--- + 1 file changed, 12 insertions(+), 3 deletions(-) + +diff --git a/tests/lib.rs b/tests/lib.rs +index 2f95b04..59f23d8 100644 +--- a/tests/lib.rs ++++ b/tests/lib.rs +@@ -663,12 +663,21 @@ fn dirs_xdg_from_env() -> io::Result<()> { + #[test] + fn version() -> io::Result<()> { + let dirs = Directories::default()?; ++ ++ let maybe_commit_hash = option_env!("GIT_COMMIT_SHORT_HASH"); ++ let maybe_commit_date = option_env!("GIT_COMMIT_DATE"); ++ let commit_info = ++ if let (Some(commit_hash), Some(commit_date)) = (maybe_commit_hash, maybe_commit_date) { ++ format!(" ({} {})", commit_hash, commit_date) ++ } else { ++ "".to_string() ++ }; ++ + let expected = format!( +- "{} {} ({} {})\n{}\n", ++ "{} {}{}\n{}\n", + env!("CARGO_PKG_NAME"), + env!("CARGO_PKG_VERSION"), +- env!("GIT_COMMIT_SHORT_HASH"), +- env!("GIT_COMMIT_DATE"), ++ commit_info, + env!("RUSTC_VERSION_SUMMARY") + ); + TestCommand::new(&dirs) +-- +2.35.1 + diff --git a/srcpkgs/sheldon/patches/0002-Fix-tests.patch b/srcpkgs/sheldon/patches/0002-Fix-tests.patch new file mode 100644 index 000000000000..416229bd3438 --- /dev/null +++ b/srcpkgs/sheldon/patches/0002-Fix-tests.patch @@ -0,0 +1,56 @@ +From 9aa06fdd5cb284daae8c48648d614e3823f3f9f3 Mon Sep 17 00:00:00 2001 +From: Ross MacArthur +Date: Sat, 29 Jan 2022 22:02:39 +0200 +Subject: [PATCH] Fix tests + +--- + src/cli.rs | 13 ++++++++++++- + src/testdata/cli/raw_opt_help.golden | 2 +- + 2 files changed, 13 insertions(+), 2 deletions(-) + +diff --git a/src/cli.rs b/src/cli.rs +index 23c644e..18300fa 100644 +--- a/src/cli.rs ++++ b/src/cli.rs +@@ -503,6 +503,7 @@ mod tests { + use std::iter; + + use pretty_assertions::assert_eq; ++ use serde::Serialize; + + fn setup() { + for (k, _) in env::vars() { +@@ -548,9 +549,19 @@ mod tests { + #[test] + fn raw_opt_help() { + setup(); ++ ++ #[derive(Serialize)] ++ struct Context { ++ version: &'static str, ++ } ++ ++ let ctx = Context { ++ version: build::CRATE_RELEASE, ++ }; ++ + for opt in &["-h", "--help"] { + let err = raw_opt_err(&[opt]); +- goldie::assert!(err.to_string()); ++ goldie::assert_template!(&ctx, err.to_string()); + assert_eq!(err.kind, clap::ErrorKind::DisplayHelp); + } + } +diff --git a/src/testdata/cli/raw_opt_help.golden b/src/testdata/cli/raw_opt_help.golden +index 93c47ce..4b6b19d 100644 +--- a/src/testdata/cli/raw_opt_help.golden ++++ b/src/testdata/cli/raw_opt_help.golden +@@ -1,4 +1,4 @@ +-sheldon 0.6.5 ++sheldon {version} + Ross MacArthur + Fast, configurable, shell plugin manager. + +-- +2.35.1 + diff --git a/srcpkgs/sheldon/template b/srcpkgs/sheldon/template new file mode 100644 index 000000000000..37202da414eb --- /dev/null +++ b/srcpkgs/sheldon/template @@ -0,0 +1,38 @@ +# Template file for 'sheldon' +pkgname=sheldon +version=0.6.6 +revision=1 +build_style=cargo +build_helper=qemu +# skip problematic tests +make_check_args="-- + --skip lock::tests::locked_config_clean + --skip lock::tests::source_lock_git_git_with_checkout + --skip lock_and_source_clean_permission_denied + --skip lock_and_source_github_git" +hostmakedepends="pkg-config" +makedepends="libcurl-devel openssl-devel zlib-devel" +checkdepends="git" +short_desc="Fast, configurable shell plugin manager" +maintainer="Marcin Puc " +license="Apache-2.0, MIT" +homepage="https://sheldon.cli.rs/" +changelog="https://raw.githubusercontent.com/rossmacarthur/sheldon/trunk/RELEASES.md" +distfiles="https://github.com/rossmacarthur/sheldon/archive/${version}.tar.gz" +checksum=9d6cdc8fe011c4defe65fbe1507e48a51f8efdeebb5d5b0b39fbde2c73566973 + +post_build() { + SHELDON=target/${RUST_TARGET}/release/sheldon + for shell in bash zsh; do + vtargetrun ${SHELDON} completions --shell ${shell} > sheldon.${shell} + done +} + +post_install() { + for shell in bash zsh; do + vcompletion sheldon.${shell} ${shell} + done + + vlicense LICENSE-MIT + vdoc README.md +}