Package Details: diffr 0.1.5-3

Git Clone URL: https://aur.archlinux.org/diffr.git (read-only, click to copy)
Package Base: diffr
Description: Word-by-word diff highlighting tool
Upstream URL: https://github.com/mookid/diffr
Licenses: MIT
Conflicts: diffr-git
Submitter: wezm
Maintainer: vasya
Last Packager: vasya
Votes: 4
Popularity: 0.000000
First Submitted: 2019-07-02 22:08 (UTC)
Last Updated: 2023-12-27 07:50 (UTC)

Dependencies (2)

Required by (0)

Sources (1)

Latest Comments

vasya commented on 2023-12-27 07:51 (UTC)

Thanks @SRChiP! Added.

SRChiP commented on 2023-12-26 07:37 (UTC)

Works on aarch64

vasya commented on 2023-08-07 11:23 (UTC)

Hi @drbb, thanks for reporting! I've fixed it.

Background info: the latest release 0.1.5 just doesn't have the relevant files yet: https://github.com/mookid/diffr/tree/9ccebfc99a758bd0672536f9ccae74933717b814/assets

The current master branch already has it, so waiting for when it gets released to get the additional man page.

drbb commented on 2023-08-07 08:43 (UTC)

Building fails:

==> Starting build()...
   Compiling libc v0.2.58
   Compiling termcolor v1.1.0
   Compiling atty v0.2.11
   Compiling diffr v0.1.5 (/home/dario/.cache/yay/diffr/src/diffr-0.1.5)
    Finished release [optimized + debuginfo] target(s) in 3.14s
pandoc: assets/diffr.1.md: openBinaryFile: does not exist (No such file or directory)
==> ERROR: A failure occurred in build().
    Aborting...
 -> error making: diffr-exit status 4
 -> Failed to install the following packages. Manual intervention is required:
diffr - exit status 4

I had to comment out lines 32-34 in PKGBUILD to make it work:

 #if command -v pandoc &> /dev/null; then
 #  pandoc -s -t man assets/diffr.1.md -o assets/diffr.1
 #fi

vasya commented on 2023-08-02 18:12 (UTC)

UPD: fixed the tests following @qubidt's suggestions below (didn't notice them at first). Also, included optional manual page generation. (PKGBUILD's official syntax doesn't have optmakedepends, so I've added it to optdepends. This trade-off is subjective and I've also documented it in the PKGBUILD itself.)

vasya commented on 2023-08-02 17:35 (UTC)

Hi all, I've adopted the package now, and upgraded to the latest version 0.1.5. If anything's broken, do write.

I've added the cargo test statement in check() at first, following the Rust package guidelines: https://wiki.archlinux.org/title/Rust_package_guidelines
However, the tests fail at least on my system. If anyone knows how to repair them, please write. The upstream code also has a few compilation warnings, so some of it is likely upstream tech debt. If anyone wants to help with raising issue/triaging, you're most welcome.

The resulting binary is working.

qubidt commented on 2023-06-23 19:16 (UTC)

Updated for v0.1.5, added the man page, and running the tests in check.

diff --git a/PKGBUILD b/PKGBUILD
index 8e2c327..ea9e192 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,23 +1,51 @@
 # Maintainer: Wesley Moore <wes@wezm.net>

 pkgname=diffr
-pkgver=0.1.4
+pkgver=0.1.5
 pkgrel=1
 pkgdesc='Word-by-word diff highlighting tool'
 arch=('i686' 'x86_64')
 url="https://github.com/mookid/diffr"
 license=('MIT')
 conflicts=('diffr-git')
-makedepends=('rust' 'cargo' 'git')
-source=("$pkgname-$pkgver.tar.gz::$url/archive/v$pkgver.tar.gz")
-sha256sums=('2613b57778df4466a20349ef10b9e022d0017b4aee9a47fb07e78779f444f8cb')
+makedepends=('rust' 'cargo' 'git' 'pandoc')
+source=("${pkgname}-${pkgver}.tar.gz::${url}/archive/v${pkgver}.tar.gz"
+        # man page added in this PR, not yet included in a release
+        "PR-89.patch::${url}/pull/89.patch")
+sha256sums=('6c5861e5b8f5d798e027fe69cc186452848dc4ae5641326b41b5c160d3e91654'
+            '91ec399544cde80cd565ed5ab375a28c3e641c25ce426975d9f5e4f95028ae72')
+
+prepare() {
+  cd "${pkgname}-${pkgver}"
+  patch -Np1 -i "${srcdir}/PR-89.patch"
+  export RUSTUP_TOOLCHAIN=stable
+  cargo fetch --locked --target "${CARCH}-unknown-linux-gnu"
+}
+
+build() {
+  cd "${pkgname}-${pkgver}"
+  export RUSTUP_TOOLCHAIN=stable
+  export CARGO_TARGET_DIR=target
+  cargo build --release --frozen
+}
+
+check() {
+  cd "${pkgname}-${pkgver}"
+  export RUSTUP_TOOLCHAIN=stable
+  export CARGO_TARGET_DIR=target
+  export DIFFR_TESTS_BINARY_PATH=${CARGO_TARGET_DIR}/release/diffr
+  cargo test --release --frozen
+}

 build() {
-  cd "$pkgname-$pkgver"
+  cd "${pkgname}-${pkgver}"
   cargo build --release
+  pandoc -s -t man assets/diffr.1.md -o assets/diffr.1
 }

 package() {
-  install -Dm755 "$srcdir/$pkgname-$pkgver/target/release/$pkgname" "$pkgdir/usr/bin/$pkgname"
-  install -Dm644 "$srcdir/$pkgname-$pkgver/LICENSE.txt" "$pkgdir/usr/share/licenses/$pkgname"
+  cd "${pkgname}-${pkgver}"
+  install -Dm755 "target/release/${pkgname}" "${pkgdir}/usr/bin/${pkgname}"
+  install -Dm644 "LICENSE.txt" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE.txt"
+  install -Dm644 "assets/diffr.1" "${pkgdir}/usr/share/man/man1/diffr.1"
 }