pkgname=meson
pkgver=1.8.3
pkgdesc="High productivity build system"
homepage="https://mesonbuild.com/"
arch=(any)
license=(Apache-2.0)
sources=("${pkgname}-${pkgver}.tar.gz")
urls=("https://github.com/mesonbuild/meson/releases/download/${pkgver}/${sources[0]}")
md5sums=("08221d2f515e759686f666ff6409a903")

src_prepare() {
  tar -xf ${distdir}/${sources[0]} --strip-components=1
}

src_build() {
  export PYTHONDONTWRITEBYTECODE=1
  pip3 wheel -w dist --no-cache-dir --no-build-isolation --no-deps $PWD
}

src_install() {
  pip3 install --no-deps --no-warn-script-location --no-index --no-cache-dir --no-user --ignore-installed --root ${pkgdir} --find-links dist ${pkgname}
  install -vDm644 data/shell-completions/bash/meson ${pkgdir}/usr/share/bash-completion/completions/meson
  install -vDm644 data/shell-completions/zsh/_meson ${pkgdir}/usr/share/zsh/site-functions/_meson
}
