# Maintainer: Christoph Reiter <reiter.christoph@gmail.com>

pkgname=meson
pkgver=0.59.1
pkgrel=1
pkgdesc='High-productivity build system'
arch=('any')
url="https://mesonbuild.com/"
license=('Apache 2')
depends=('python' 'python-setuptools' 'ninja')
source=("https://github.com/mesonbuild/${pkgname}/releases/download/${pkgver}/${pkgname}-${pkgver}.tar.gz"{,.asc}
        "0001-cygwin-disguise.patch")
sha256sums=('db586a451650d46bbe10984a87b79d9bcdc1caebf38d8e189f8848f8d502356d'
            'SKIP'
            'd923909ef135520caaf09608651f13e5b3090911b228795cbf5376b55a587903')
validpgpkeys=("19E2D6D9B46D8DAA6288F877C24E631BABB1FE70") # Jussi Pakkanen <jpakkane@gmail.com>

prepare() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  patch -p1 -i "${srcdir}"/0001-cygwin-disguise.patch
}

build() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  /usr/bin/python setup.py build
}

package() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  /usr/bin/python setup.py install --root="${pkgdir}/" --optimize=1

  install -Dm644 COPYING "${pkgdir}/usr/share/licenses/${pkgname}/COPYING"
}
