summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 1000cda4183b81edfef849c7d2e14ff343cb42ba (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
# Maintainer: Walter C <bitlord@disroot.org>
# Contributor: Wesley Moore <wes@wezm.net>

pkgname="pastel-git"
_pkgname="pastel"
pkgver=0.6.1.310.g282f462
pkgrel=1
pkgdesc="A command-line tool to generate, analyze, convert and manipulate colors"
arch=("i686" "x86_64" "arm" "aarch64")
url="https://github.com/sharkdp/pastel"
license=("MIT" "Apache")
depends=()
makedepends=("rust" "cargo" "git")
provides=("pastel")
conflicts=("pastel")
source=("$_pkgname::git+https://github.com/sharkdp/pastel.git")
sha384sums=("SKIP")

pkgver() {
    cd "$_pkgname"
    echo "$(grep '^version =' Cargo.toml|head -n1|cut -d\" -f2).$(git rev-list --count HEAD).g$(git rev-parse --short HEAD)"
}

build() {
    cd $_pkgname
    export SHELL_COMPLETIONS_DIR="$PWD/completions"
    cargo build --release --locked
}
    
check() {
    cd $_pkgname
    cargo test --release --locked
}

package() {
    cd "$srcdir/$_pkgname"
    install -Dm755 target/release/$_pkgname "$pkgdir/usr/bin/$_pkgname"
    install -Dm644 completions/_pastel \
    "$pkgdir/usr/share/zsh/site-functions/_pastel"
    install -Dm644 completions/pastel.bash \
    "$pkgdir/usr/share/bash-completion/completions/pastel"
    install -Dm644 completions/pastel.fish \
    "$pkgdir/usr/share/fish/vendor_completions.d/pastel.fish"
    for license in APACHE MIT
        do install -Dm644 "LICENSE-$license" \
        "$pkgdir/usr/share/licenses/$pkgname/LICENSE-$license"
    done
}