summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 13633937f90558f5e1045e53e9d28ff330c456c2 (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
#!/hint/bash
# Maintainer: Marek 'seqre' Grzelak <aur@seqre.dev>

pkgname='baca-cli'
pkgver='v0.5.0'
pkgrel=1
pkgdesc="CLI client for the Jagiellonian University's BaCa online judge"
arch=('x86_64')
url="https://github.com/hjaremko/baca-cli"
license=('MIT')
depends=('bzip2' 'openssl')
makedepends=('git' 'rust' 'cargo')
checkdepends=('rust' 'cargo')
provides=('baca')
source=("git+https://github.com/hjaremko/${pkgname}.git#tag=${pkgver}")
sha256sums=('SKIP')

_binaryname='baca'

pkgver() {
	cd "${pkgname}"
	git describe --abbrev=0 --tags
}

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

build() {
	cd "${pkgname}"
	RUSTUP_TOOLCHAIN=stable cargo build --release --frozen --all-features --target-dir=target
}

check() {
	cd "${pkgname}"
	RUSTUP_TOOLCHAIN=stable cargo test --release --frozen --all-features --target-dir=target
}

package() {
	cd "${pkgname}"
	install -Dm 755 target/release/${_binaryname} -t "${pkgdir}/usr/bin"
	install -Dm 644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}