summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: ba926488d894a9cb54c11d1cb5b91666508034b2 (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
# Maintainer: James Appleton <james.appleton01@gmail.com>
pkgname="flaq"
pkgdesc="A simple CLI tool for modifying and querying metadata tags for \`.flac\` files."
pkgrel=3
pkgver="0.4.0"

makedepends=("git" "cargo" "jq")
depends=("glibc" "gcc-libs")
url="https://github.com/jmsapt/flaq"
source=("$pkgname-$pkgver.tar.gz::https://static.crates.io/crates/$pkgname/$pkgname-$pkgver.crate")
arch=("any")
license=("MIT")
sha256sums=('SKIP')

prepare() {
	cd "$pkgname-$pkgver"
	export RUSTUP_TOOLCHAIN=stable
	cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')"
}

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

check() {
	cd "$pkgname-$pkgver"
	# export RUSTUP_TOOLCHAIN=stable
	# cargo test --frozen --all-features
}

package() {
	cd "$pkgname-$pkgver"
	# install binary
	install -Dm0755 -t "$pkgdir/usr/bin/" "target/release/$pkgname"

	# install auto completion scripts
	install -Dm644 "target/scripts/$pkgname.bash" "${pkgdir}/usr/share/bash-completion/completions/$pkgname.bash"
	install -Dm644 "target/scripts/$pkgname.fish" "${pkgdir}/usr/share/fish/vendor_completions.d/$pkgname.fish"
	install -Dm644 "target/scripts/_$pkgname" "${pkgdir}/usr/share/zsh/site-functions/_$pkgname"

	install -d "$pkgdir/usr/share/"
}

# pkgver() {
# 	cd "${pkgname}"
# 	cargo metadata --format-version=1 --no-deps | jq ".packages[0].version"
# }