summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: dc01f12cdd1b73f3e81b4a1fb0d185ca7ffa09bc (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
# Maintainer: Jasper <j@sperp.dev>

pkgname=gpustat-git
pkgver=r13.4e19078
pkgrel=1
pkgdesc="GPU monitoring tool"
depends=()
makedepends=('rust' 'cargo' 'git')
license=('apache')
arch=('i686' 'x86_64' 'aarch64')
url="https://github.com/arduano/gpustat"

source=("$pkgname::git+https://github.com/arduano/gpustat#branch=master")
sha256sums=('SKIP')

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

prepare() {
    cd "$pkgname"
    cargo fetch --target "$CARCH-unknown-linux-gnu"
}

build() {
    cd "$pkgname"
    export RUSTUP_TOOLCHAIN=stable
    export CARGO_TARGET_DIR=target
    cargo build --release
}

package() {
    cd "$pkgname"
    install -Dm0755 -t "$pkgdir/usr/bin/" "target/release/gpustat"
}