summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 97c8695fe637f7f92e8fe36689793dff2dff6b47 (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
# Maintainer: lmartinez-mirror
pkgbase=vim-autoformat-git
pkgname=('vim-autoformat-git' 'neovim-autoformat-git')
pkgver=r491.781c72c
pkgrel=1
pkgdesc="Provides easy code formatting by integrating existing formatters"
arch=('any')
url="https://github.com/chiel92/vim-autoformat"
license=('MIT')
groups=('vim-plugins' 'neovim-plugins')
makedepends=('git')
source=("$pkgbase::git+$url")
md5sums=('SKIP')

pkgver() {
  cd "$pkgbase"
  printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

package_vim-autoformat-git()  {
  depends=('vim')
  provides=("${pkgbase%-git}")
  conflicts=("${pkgbase%-git}")

  cd "$pkgbase"
  find plugin -type f -exec install -Dm 644 '{}' "$pkgdir/usr/share/vim/vimfiles/{}" \;
  install -Dm 644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname/"
  install -Dm 644 README.md -t "$pkgdir/usr/share/doc/$pkgname/"
}

package_neovim-autoformat-git() {
  depends=('neovim' 'python-pynvim')
  provides=("${pkgbase%-git}")
  conflicts=("${pkgbase%-git}")

  cd "$pkgbase"
  find plugin -type f -exec install -Dm 644 '{}' "$pkgdir/usr/share/nvim/runtime/{}" \;
  install -Dm 644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname/"
  install -Dm 644 README.md -t "$pkgdir/usr/share/doc/$pkgname/"
}