summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 3b1f52ed5f012a6a6117254d4aaada3bfe40f563 (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
pkgname='sweep-rs-git'
pkgdesc='Sweep is a tool for interactive search through a list of entries.'
provides=('sweep-rs')
url='https://github.com/aslpavel/sweep-rs'
arch=('x86_64')
pkgrel=1
pkgver=r306.392555d
source=('sweep-rs::git+https://github.com/aslpavel/sweep-rs')
makedepends=(cargo)
sha1sums=('SKIP')
license=('MIT')

pkgver() {
    cd sweep-rs
    printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short=7 HEAD)"
}

prepare() {
    cd sweep-rs
    export RUSTUP_TOOLCHAIN=stable
    cargo fetch --locked --target "$CARCH-unknown-linux-gnu"
}

check() {
    cd sweep-rs
    export RUSTUP_TOOLCHAIN=stable
    cargo test --frozen --all-features
}

build() {
    cd sweep-rs
    export RUSTUP_TOOLCHAIN=stable
    export CARGO_TARGET_DIR=target
    cargo build --frozen --release --all-features
}

package() {
    cd sweep-rs
    install -Dm0755 -t "$pkgdir/usr/bin/" "target/release/sweep"
    install -Dm644 LICENSE "$pkgdir/usr/share/licenses/sweep-rs/LICENSE"
}