# Maintainer (aur): jsteel <mail at jsteel dot org>
# Contributor: nblock <nblock [/at\] archlinux DOT us>
# Contributor: William Díaz <wdiaz [at] archlinux [dot] us>
# Contributor: Wolfgang Frisch <xororand@frexx.de>
# Contributor: Leandro Inacio <carvalho.inacio@gmail.com>
# Maintainer: Aurélien Desbrières <aurelien@hackers.camp>

pkgname=vim-colorschemes
pkgver=20140623
pkgrel=1
pkgdesc="A very large collection of color schemes from vim.org"
url="http://packages.gentoo.org/package/app-vim/colorschemes"
arch=('any')
conflicts=('vim-colorsamplerpack' 'vim-solarized-git')
depends=('vim')
license=('vim' 'GPL2' 'public-domain' 'as-is')
groups=('vim-plugins')
source=("http://dev.gentoo.org/~radhermit/vim/colorschemes-$pkgver.tar.bz2")
sha256sums=('9096b0843e2bffd0183fc8ce356994e24016fb046621d80b9efff068542c2f08')

build() {
  cd "$srcdir"/colorschemes-$pkgver

  patch -Np0 -i patches/kib_plastic.patch
  patch -Np0 -i patches/potts.patch

  # fix line endings
  find . -name '*.vim' -exec sed -i -e 's,\r,\n,g' {} \;
}

package() {
  cd "$srcdir"/colorschemes-$pkgver

  install -dm755 "$pkgdir"/usr/share/vim/vimfiles/colors
  install -m644 colors/* "$pkgdir"/usr/share/vim/vimfiles/colors/

  # delete existing colors
  rm -r "$pkgdir"/usr/share/vim/vimfiles/colors/{blue.vim,delek.vim,desert.vim,torte.vim}
}
