summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: afcdcc3d00b923d1c3c00fb5b20d4e2799ceb133 (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
# Maintainer: Michael Zhang <mail@mzhang.io>

pkgname=garbage
pkgver=0.4.1
pkgrel=1
pkgdesc='Command-line interface to the FreeDesktop Trash can'
url='https://git.sr.ht/~mzhang/garbage'
arch=('any')
license=('GPL3')
makedepends=('cargo')
source=("https://git.sr.ht/~mzhang/${pkgname}/archive/v${pkgver}.tar.gz")
sha256sums=('ffebf19c29e6365be184b94e0db67e6b6c993621f05883c48e7f3695adbe20f3')

build() {
    cd "${pkgname}-v${pkgver}"
    cargo build --release --locked --all-features --target-dir=target
}

package() {
    cd "${pkgname}-v${pkgver}"
    install -Dm 755 target/release/${pkgname} -t ${pkgdir}/usr/bin

    mkdir -p \
      "${pkgdir}/usr/share/bash-completion/completions" \
      "${pkgdir}/usr/share/fish/vendor_completions.d" \
      "${pkgdir}/usr/share/zsh/site-functions"

    "${pkgdir}/usr/bin/${pkgname}" generate-completions bash > "${pkgdir}/usr/share/bash-completion/completions/${pkgname}"
    "${pkgdir}/usr/bin/${pkgname}" generate-completions fish > "${pkgdir}/usr/share/fish/vendor_completions.d/${pkgname}.fish"
    "${pkgdir}/usr/bin/${pkgname}" generate-completions zsh > "${pkgdir}/usr/share/zsh/site-functions/_${pkgname}"
}