arch-pkgs/cargo-geiger/PKGBUILD

51 lines
1.1 KiB
Bash
Raw Normal View History

2021-08-14 10:29:24 +00:00
# Maintainer: George Rawlinson <grawlinson@archlinux.org>
pkgname=cargo-geiger
2022-06-18 00:58:22 +00:00
pkgver=0.11.3
2021-08-14 10:29:24 +00:00
pkgrel=1
2022-06-18 00:58:22 +00:00
pkgdesc='Detects usage of unsafe Rust in a Rust crate and its dependencies'
2021-08-14 10:29:24 +00:00
arch=('x86_64')
2022-06-18 00:58:22 +00:00
url='https://github.com/rust-secure-code/cargo-geiger'
2021-08-14 10:29:24 +00:00
license=('Apache' 'MIT')
depends=('curl')
makedepends=('git' 'rust')
options=('!lto')
2022-06-18 00:58:22 +00:00
_commit='ce60c0b49131c1d937353f4c221ca43f22d52ced'
source=("$pkgname::git+$url.git#commit=$_commit")
md5sums=('SKIP')
pkgver() {
cd "$pkgname"
git describe --tags | sed "s/(cargo-geiger-serde\|cargo-geiger\|geiger)//;s/-//"
}
2021-08-14 10:29:24 +00:00
prepare() {
cd "$pkgname"
2021-08-14 10:29:24 +00:00
# download dependencies
cargo fetch --locked --target "$CARCH-unknown-linux-gnu"
}
build() {
cd "$pkgname"
2021-08-14 10:29:24 +00:00
cargo build --release --frozen
}
check() {
cd "$pkgname"
2021-08-14 10:29:24 +00:00
cargo test --frozen
}
package() {
cd "$pkgname"
2021-08-14 10:29:24 +00:00
# binary
install -vDm755 -t "$pkgdir/usr/bin" "target/release/$pkgname"
# licenses
install -vDm644 -t "$pkgdir/usr/share/licenses/$pkgname" cargo-geiger/LICENSE*
# documentation
install -vDm644 -t "$pkgdir/usr/share/doc/$pkgname" *.md
}