summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: df5cb3090e1324cce768c63390443f4fc9399ed6 (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
47
48
49
50
51
52
53
54
55
56
57
58
# Maintainer: Luis Martinez <luis dot martinez at disroot dot org>

pkgname=amdgpud
pkgver=1.0.11
_commit=f1d7f10
pkgrel=1
pkgdesc="Fan control service for AMD GPUs"
arch=('x86_64')
url="https://github.com/eraden/amdgpud"
license=('Apache' 'MIT')
depends=('gcc-libs' 'libxcb')
makedepends=('cargo' 'cmake' 'git' 'shaderc')
backup=("etc/$pkgname/config.toml")
source=("$pkgname::git+$url#commit=$_commit?signed")
sha256sums=('SKIP')
validpgpkeys=(
	'0768AEEA335417256AEEA0910012845A89C7352B' ## Adrian Wozniak
	'5DE3E0509C47EA3CF04A42D34AEE18F83AFDEB23' ## GitHub
)
## use command below to import public key
## curl https://github.com/eraden.gpg | gpg --import

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

build() {
	export RUSTUP_TOOLCHAIN=stable
	export CARGO_TARGET_DIR=target
	cd "$pkgname"
	cargo build --release --frozen --target "$CARCH-unknown-linux-gnu"
	## use the line below if your system doesn't use wayland
	# cargo build --release --frozen --target "$CARCH-unknown-linux-gnu" --no-default-features --features xorg-glium
}

check() {
	export RUSTUP_TOOLCHAIN=stable
	cd "$pkgname"
	cargo test --frozen --target "$CARCH-unknown-linux-gnu"
}

package() {
	cd "$pkgname"
	find "target/$CARCH-unknown-linux-gnu/release/" \
		-maxdepth 1 \
		-executable \
		-type f \
		-exec install -D -t "$pkgdir/usr/bin/" '{}' \+
	find services \
		-type f \
		-name '*.service' \
		-exec install -Dm644 -t "$pkgdir/usr/lib/systemd/system/" '{}' \+
	install -Dm644 LICENSE.APACHE2.txt "$pkgdir/usr/share/licenses/$pkgname/LICENSE-APACHE"
	install -Dm644 LICENSE.md "$pkgdir/usr/share/licenses/$pkgname/LICENSE-MIT"
	install -Dm644 README.md -t "$pkgdir/usr/share/doc/$pkgname/"
	install -Dm644 examples/default_config.toml "$pkgdir/etc/$pkgname/config.toml"
}