summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 654677dcb9ba9e7ceefb954d2afcf9a0a11fbb22 (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
# Maintainer: éclairevoyant

_pkgname=evremap
pkgname="$_pkgname-git"
pkgver=r30.85f10af
pkgrel=1
pkgdesc='Systemwide keyboard input remapper (written by @wez)'
arch=(x86_64)
url="https://github.com/wez/$_pkgname"
license=(MIT)
depends=(libevdev)
makedepends=(cargo git rust)
provides=("$_pkgname")
conflicts=("$_pkgname")
source=("git+$url.git")
b2sums=('SKIP')

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

prepare() {
	export RUSTUP_TOOLCHAIN=stable

	cd $_pkgname
	cargo update
	cargo fetch --locked --target "$CARCH-unknown-linux-gnu"
}

build() {
	export RUSTUP_TOOLCHAIN=stable
	export CARGO_TARGET_DIR=target

	cd $_pkgname
	cargo build --frozen --release --all-features
}

check() {
	export RUSTUP_TOOLCHAIN=stable

	cd $_pkgname
	cargo test --frozen --all-features
}

package() {
	cd $_pkgname
	install -Dm755 target/release/$_pkgname -t "$pkgdir/usr/bin/"
	install -Dm644 $_pkgname.service -t "$pkgdir/usr/lib/systemd/system/"
	install -Dm644 LICENSE.md "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}