# Contributor: Joe Searle # Maintainer: Joe Searle pkgname=pastel pkgver=0.7.0 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="fb34df63986e3b2ada3935f381eef5e06a6ac01078cef99b2a60155b5da7bc34c2aac57dcfc2ab4a42941c125c6245fb31f68fd68c447c656627027ed07ee2bc pastel-0.7.0.tar.gz"