# Maintainer: Mazhar Hussain <realmazharhussain@gmail.com>

_realname=blueprint-compiler
pkgbase=mingw-w64-${_realname}
pkgname=${MINGW_PACKAGE_PREFIX}-${_realname}
pkgver=0.18.0
pkgrel=1
pkgdesc='A markup language for GTK user interfaces (mingw-w64)' 
url='https://jwestman.pages.gitlab.gnome.org/blueprint-compiler/'
msys2_repository_url='https://gitlab.gnome.org/jwestman/blueprint-compiler'
license=('spdx:LGPL-3.0-or-later')
arch=(any)
mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64')
depends=(${MINGW_PACKAGE_PREFIX}-python-gobject)
makedepends=(${MINGW_PACKAGE_PREFIX}-meson)
source=(https://gitlab.gnome.org/jwestman/blueprint-compiler/-/archive/v$pkgver/blueprint-compiler-v$pkgver.tar.gz)
sha256sums=('703c7ccd23cb6f77a8fe9c8cae0f91de9274910ca953de77135b6e79dbff1fc3')

build() {
  MSYS2_ARG_CONV_EXCL="--prefix=" \
  "${MINGW_PREFIX}"/bin/meson setup \
    --prefix="${MINGW_PREFIX}" \
    $_realname-v$pkgver \
    build-${MSYSTEM}

  meson compile -C build-${MSYSTEM}
}

check() {
  meson test -C build-${MSYSTEM}
}

package() {
  meson install -C build-${MSYSTEM} --destdir="$pkgdir"
  install -Dm644 $_realname-v$pkgver/COPYING "$pkgdir/$MINGW_PREFIX"/share/licenses/$_realname/COPYING
}
