aboutsummaryrefslogtreecommitdiffstats
path: root/testing/pastel/APKBUILD
blob: 88d21e153d1dbbd4c7e4dabe2b547ea0f04600fe (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
# Contributor: Joe Searle <joe@jsearle.net>
# Maintainer: Joe Searle <joe@jsearle.net>
pkgname=pastel
pkgver=0.6.1
pkgrel=0
pkgdesc="A command-line tool to generate, analyze, convert and manipulate colors"
url="https://github.com/sharkdp/pastel"
arch="all !s390x"
license="Apache-2.0"
makedepends="rust cargo"
source="$pkgname-$pkgver.tar.gz::https://github.com/sharkdp/pastel/archive/v$pkgver.tar.gz"
subpackages="$pkgname-bash-completion:bashcomp $pkgname-zsh-completion:zshcomp $pkgname-fish-completion:fishcomp"

build() {
	export SHELL_COMPLETIONS_DIR="$builddir/completions"
	cargo build --release
}

check() {
	cargo test
}

package() {
	install -Dm755 "target/release/pastel" "$pkgdir/usr/bin/$pkgname"
}

bashcomp() {
	cd $builddir
	pkgdesc="Bash completion for $pkgname"
	install_if="$pkgname=$pkgver-r$pkgrel bash-completion"
	install -Dm644 completions/pastel.bash \
		"$subpkgdir/usr/share/bash-completion/completions/pastel"
}

zshcomp() {
	cd $builddir
	pkgdesc="Zsh completion for $pkgname"
	install_if="$pkgname=$pkgver-r$pkgrel zsh"
	install -Dm644 completions/_pastel \
		"$subpkgdir/usr/share/zsh/site-functions/_pastel"
}

fishcomp() {
	cd $builddir
	pkgdesc="Fish completion for $pkgname"
	install_if="$pkgname=$pkgver-r$pkgrel zsh"
	install -Dm644 completions/pastel.fish \
		"$subpkgdir/usr/share/fish/vendor_completions.d/pastel.fish"
}

sha512sums="b8392ee40574fe366698ffb5f409efaceeaddf859d61d31c44cd04fe558f7166380464f47641abf4d6d485b764182025b6ad8f65a933ea3ef45d4224ed517381  pastel-0.6.1.tar.gz"