summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: ad33ac11f5c5516d2c78e0af089c730eafd3b5c7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# Maintainer: Matthieu LAURENT <matthieu.laurent69 [at] proton.me>
# Contributor: nerdypepper <nerdy [at] peppe.rs>

_pkgname=statix
pkgname=$_pkgname-git
pkgver=0.5.4.r22.gd324490
pkgrel=2
pkgdesc='Lints and suggestions for the nix programming language '
arch=(x86_64)
url=https://github.com/nerdypepper/statix
license=(MIT)
provides=($_pkgname)
conflicts=($_pkgname)
depends=()
makedepends=(cargo git)
source=($pkgname::git+https://github.com/nerdypepper/statix.git)
sha256sums=('SKIP')
options=()

prepare() {
    cd "$srcdir"/$pkgname
    export RUSTUP_TOOLCHAIN=stable
    cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')"
}

build() {
    cd "$srcdir"/$pkgname
    cargo build --frozen --release
}

check() {
    cd "$srcdir"/$pkgname
    export RUSTUP_TOOLCHAIN=stable
    cargo test --frozen
}

pkgver() {
  cd "$pkgname"
  git describe --long --abbrev=7 | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

package() {
    cd "$srcdir"/$pkgname
    install -Dm755 -t "$pkgdir"/usr/bin target/release/$_pkgname
    install -Dm644 -t "$pkgdir"/usr/share/licenses/$pkgname LICENSE
}