rmpkg: cargo-sort

This commit is contained in:
George Rawlinson 2021-08-13 07:14:37 +00:00
parent 4e2456fd00
commit 4446de2068
Signed by: grawlinson
GPG key ID: E0959FEA8B550539

View file

@ -1,40 +0,0 @@
# Maintainer: George Rawlinson <grawlinson@archlinux.org>
# Contributor: Dominic Meiser [git at msrd0 dot de]
pkgname=cargo-sort
pkgver=1.0.5
pkgrel=1
pkgdesc='Check if tables and items in a .toml file are lexically sorted'
arch=('x86_64')
url="https://github.com/DevinR528/cargo-sort"
license=('Apache' 'MIT')
depends=('gcc-libs')
makedepends=('cargo' 'llvm' 'clang')
source=("$pkgname-$pkgver.tar.gz::$url/archive/v$pkgver.tar.gz")
b2sums=('647ecaea8e6b5a1f53460996b1374a502c4d0356a29d982c67ee83682710e74a7f709c2495291c1be70e572e77176cbbe29fc7d1728ab88283d586bf948ff40b')
build() {
cd "$pkgname-$pkgver"
RUSTUP_TOOLCHAIN=stable cargo build --release --locked --target-dir=target
}
check() {
cd "$pkgname-$pkgver"
RUSTUP_TOOLCHAIN=stable cargo test --locked --target-dir=target
}
package() {
cd "$pkgname-$pkgver"
# binary
install -vDm755 -t "$pkgdir/usr/bin" "target/release/$pkgname"
# licenses
install -vd "$pkgdir/usr/share/licenses/$pkgname"
sed -n '/^####.*$/,/^<\/sub>$/p' README.md \
> "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
# documentation
install -vDm644 -t "$pkgdir/usr/share/doc/$pkgname" README.md
cp -vr examp "$pkgdir/usr/share/doc/$pkgname/examples"
}