# Maintainer: Alexey Pavlov <alexpux@gmail.com>
# Maintainer: Ray Donnelly <ray.donnelly@gmail.com>

_realname=gyp
pkgname=${_realname}-git
pkgver=r2163.caa60026
pkgrel=3
pkgdesc="GYP can Generate Your Projects"
url="https://code.google.com/p/gyp/"
arch=('i686' 'x86_64')
provides=("gyp")
conflicts=("gyp")
replaces=("gyp-svn")
makedepends=('git')
depends=('python' 'python-setuptools')
license=('custom')
_commit="caa60026e223fc501e8b337fd5086ece4028b1c6"
source=("git+https://chromium.googlesource.com/external/gyp#commit=${_commit}"
        '0001-msys-ize.patch')
sha256sums=('SKIP'
            'fc53fc2f49ce1895c13aa330c814db29288a445e87a47d7bc81f6a6ab400df5f')

pkgver() {
  cd "${srcdir}"/${_realname}
  printf "r%s.%s" $(("$(git rev-list --count ${_commit})" + 1)) "$(git rev-parse --short "${_commit}")"
}

prepare() {
  cd "${srcdir}"/${_realname}

  patch -Np1 -i "${srcdir}/0001-msys-ize.patch"
}

package() {
  cd "${srcdir}"/${_realname}
  python3 setup.py install --root="${pkgdir}"
}
