summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: a87f7a4dc3a2261a2f84716f33da5609cdf73132 (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: Ewout van Mansom <ewout@vanmansom.name>

pkgname=amdfand-git
pkgver=v1.0.12.r5.g772498d
pkgrel=1
pkgdesc="AMDGPU fan speed management tool"
url="https://github.com/Eraden/amdgpud"
license=('MIT' 'Apache-2.0')
source=("amdfand::git+https://github.com/Eraden/amdgpud.git")
arch=('x86_64')
conflicts=('amdfand-bin' 'amdfand')
provides=('amdfand')
sha512sums=('SKIP')
makedepends=('git' 'cargo')
optdepends=('amdmond' 'amdguid-glow' 'amdguid-wayland' 'amdvold')

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

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

build() {
  cd "${pkgname%-git}"
  export RUSTUP_TOOLCHAIN=stable
  export CARGO_TARGET_DIR=target
  cargo build --frozen --release --bin amdfand
}

check() {
  cd "${pkgname%-git}"
  export RUSTUP_TOOLCHAIN=stable
  cargo test --frozen --bin amdfand
}

package() {
  cd "${pkgname%-git}"
  install -D -m 0755 -t "$pkgdir/usr/bin/" "target/release/${pkgname%-git}"
  install -D -m 0755 -t "$pkgdir/usr/lib/systemd/system" "services/amdfand.service"
}