summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 14d70fbd63e8c24f493e4968f8ca292ffc26a833 (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
# Maintainer: ObserverOfTime <chronobserver@disroot.org>

pkgname=yarn-completion-git
pkgver=0.17.0.r0.g30262cf
pkgrel=5
pkgdesc='Bash completion for Yarn'
url='https://github.com/dsifford/yarn-completion'
arch=('any')
license=('MIT')
depends=('bash' 'bash-completion' 'yarn')
makedepends=('git')
source=("git+${url}.git" '0001-fix-tests.patch')
sha256sums=('SKIP' 'e00774fa650fb037ae62e0963308baee7509a4bbeea445193684db2c2e8a18d2')

pkgver() {
  cd ${pkgname%-git}
  # using git rev-list to force the latest tag to show up
  git describe --long "$(git rev-list --tags --max-count=1)" | sed 's/\([^-]*-g\)/r\1/;s/-/./g;s/^v//'
}

prepare() {
  cd ${pkgname%-git}
  patch -p0 tests/test -i ../0001-fix-tests.patch
}

check() {
  cd ${pkgname%-git}
  bash tests/test
}

package() {
  cd ${pkgname%-git}
  install -Dm644 LICENSE "$pkgdir/usr/share/licenses/${pkgname%-git}/LICENSE"
  install -Dm644 "${pkgname%-git}.bash" "$pkgdir/usr/share/bash-completion/completions/yarn"
}