From 22b31065aef12ec6b836857f563d7b6a4d33aeeb Mon Sep 17 00:00:00 2001 From: Yigit Sever Date: Wed, 3 Nov 2021 12:20:14 +0300 Subject: Run tests and install completions Upstream builds completions during compilation --- PKGBUILD | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'PKGBUILD') diff --git a/PKGBUILD b/PKGBUILD index 6d00377..417d414 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -2,12 +2,13 @@ pkgname=ouch pkgver=0.3.1 -pkgrel=1 +pkgrel=2 pkgdesc="Painless compression and decompression in the terminal" arch=('x86_64') url="https://github.com/ouch-org/ouch" license=('MIT') makedepends=('cargo') +conflicts=(${pkgname}-git) source=("${pkgname}-${pkgver}.tar.gz::${url}/archive/${pkgver}.tar.gz") sha256sums=('269abaf5ac2f80da3796dbf5e73419c1b64104d1295f3ff57965141f079e6f6d') @@ -20,10 +21,23 @@ build() { cd "$pkgname-$pkgver" export RUSTUP_TOOLCHAIN=stable export CARGO_TARGET_DIR=target - cargo build --frozen --release --all-features + GEN_COMPLETIONS=1 cargo build --frozen --release --all-features +} + +check() { + cd "$pkgname-$pkgver" + export RUSTUP_TOOLCHAIN=stable + cargo test --frozen --all-features } package() { cd "$pkgname-$pkgver" install -Dm0755 -t "$pkgdir/usr/bin/" "target/release/$pkgname" + + cd target/release/build/ouch-*/out/completions + sed -i "s/':output -- The resulting file. It's extensions can be used to specify the compression formats:_files'/\":output -- The resulting file. It's extensions can be used to specify the compression formats:_files\"/" _ouch + + install -Dm0644 ${pkgname}.bash "${pkgdir}/usr/share/bash-completion/completions/${pkgname}" + install -Dm0644 ${pkgname}.fish "${pkgdir}/usr/share/fish/vendor_completions.d/${pkgname}.fish" + install -Dm0644 _${pkgname} "${pkgdir}/usr/share/zsh/site-functions/_${pkgname}" } -- cgit v1.2.3-70-g09d2