# Maintainer: lilydjwg <lilydjwg@gmail.com>

pkgname=vim-rust-git
pkgver=20221127
pkgrel=3
pkgdesc="Rust language support for Vim"
arch=('any')
depends=('vim')
makedepends=('git')
url="https://github.com/rust-lang/rust.vim"
license=('MIT' 'Apache-2.0')
source=(${pkgname%-git}::git+https://github.com/rust-lang/rust.vim)
sha256sums=('SKIP')
provides=('vim-rust')
conflicts=('vim-rust')
optdepends=('rust: for RustRun and similar commands'
            'vim-syntastic: syntax checking')

pkgver() {
  cd ${pkgname%-git}
  TZ=UTC git log -1 --format="%cd" --date=short-local | sed "s|-||g"
}

package() {
  cd ${pkgname%-git}

  msg 'Installing dirs...'
  install -dm 755 "$pkgdir/usr/share/vim/vimfiles"
  for _dir in after autoload compiler doc ftdetect ftplugin indent plugin syntax syntax_checkers ctags; do
    cp -dpr --no-preserve=ownership $_dir "$pkgdir/usr/share/vim/vimfiles/$_dir"
  done
}
