From 0c08f350f90c55417909b36f99f233d9a9322a8e Mon Sep 17 00:00:00 2001 From: 0x5c Date: Sat, 7 May 2022 00:39:18 -0400 Subject: [PATCH] New package: riff-2.16 Fixes #36885 --- srcpkgs/riff/patches/doublebuild.patch | 14 ++++++++++++++ srcpkgs/riff/patches/git_version.patch | 17 +++++++++++++++++ srcpkgs/riff/template | 23 +++++++++++++++++++++++ 3 files changed, 54 insertions(+) create mode 100644 srcpkgs/riff/patches/doublebuild.patch create mode 100644 srcpkgs/riff/patches/git_version.patch create mode 100644 srcpkgs/riff/template diff --git a/srcpkgs/riff/patches/doublebuild.patch b/srcpkgs/riff/patches/doublebuild.patch new file mode 100644 index 000000000000..58b870cc18e6 --- /dev/null +++ b/srcpkgs/riff/patches/doublebuild.patch @@ -0,0 +1,14 @@ +Slight hack to prevent a rebuild in the install phase + +-- + +--- a/Cargo.toml ++++ b/Cargo.toml +@@ -19,6 +19,7 @@ + bytecount = "0.6.2" + num_cpus = "1.13.0" + threadpool = "1.8.1" ++syn = {version = "1.0.48", features = ["full"]} + + [dev-dependencies] + pretty_assertions = "0.6.1" diff --git a/srcpkgs/riff/patches/git_version.patch b/srcpkgs/riff/patches/git_version.patch new file mode 100644 index 000000000000..70a44da15d3e --- /dev/null +++ b/srcpkgs/riff/patches/git_version.patch @@ -0,0 +1,17 @@ +Allow the version to be set to something, otherwise the build breaks +We add a dummy string that can easily be vsed'd in post_patch() with +the correct version number. + +-- + +--- a/src/main.rs ++++ b/src/main.rs +@@ -61,7 +61,7 @@ + + const PAGER_FORKBOMB_STOP: &str = "_RIFF_IGNORE_PAGER"; + +-const GIT_VERSION: &str = git_version!(); ++const GIT_VERSION: &str = git_version!(fallback = "XBPS-PACKAGE-VERSION"); + + fn highlight_diff(input: &mut dyn io::Read, output: W) { + let mut line_collector = LineCollector::new(output); diff --git a/srcpkgs/riff/template b/srcpkgs/riff/template new file mode 100644 index 000000000000..d2055bdad161 --- /dev/null +++ b/srcpkgs/riff/template @@ -0,0 +1,23 @@ +# Template file for 'riff' +pkgname=riff +version=2.16 +revision=1 +build_style=cargo +short_desc="Diff filter highlighting which line parts have changed" +maintainer="0x5c " +license="MIT" +homepage="https://github.com/walles/riff" +distfiles="https://github.com/walles/riff/archive/refs/tags/${version}.tar.gz" +checksum=3f7c8e6f2602b97849422f8ad3e1c9fec7fc8cbaf7e7a8ea0856ee8a9cfe7091 +# The checks don't provide anything to us and rely on no target being specified +make_check=no + +post_patch() { + # This, along with patches/git_version.patch, is needed + # to set the version properly. + vsed -e "s|XBPS-PACKAGE-VERSION|${version}|" -i "src/main.rs" +} + +post_install() { + vlicense LICENSE +}