summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 7b62c689f8b769201d4224abb344a27f8140d3d7 (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
# Maintainer: Hans-Nikolai Viessmann <hans AT viess DOT mn>

pkgname=lapin-git
pkgver=r75.a31e5c4
pkgrel=1
pkgdesc="Terminal strategy game about a rabbit"
arch=('x86_64')
url="https://github.com/Canop/lapin"
license=('MIT')
depends=('gcc-libs')
makedepends=('git' 'cargo')
provides=("${pkgname%-git}")
conflicts=("${pkgname%-git}")
options=()
install=
source=("lapin::git+${url}.git")
sha256sums=('SKIP')

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

prepare () {
	cd "$srcdir/${pkgname%-git}"
    cargo fetch --locked
}

build() {
	cd "$srcdir/${pkgname%-git}"
    cargo build --release --locked --all-features
}

check() {
	cd "$srcdir/${pkgname%-git}"
    cargo test --release --locked
}

package() {
	cd "$srcdir/${pkgname%-git}"
    install -Dm755 target/release/${pkgname%-git} -t "${pkgdir}/usr/bin"
    install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}