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

_realname=libxml++-5.0
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=5.6.0
pkgrel=1
pkgdesc="C++ bindings to libxml2 (mingw-w64)"
url="https://libxmlplusplus.github.io/libxmlplusplus/"
msys2_repository_url="https://github.com/libxmlplusplus/libxmlplusplus"
arch=('any')
mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64')
license=('spdx:LGPL-2.1-or-later')
depends=(
  "${MINGW_PACKAGE_PREFIX}-cc-libs"
  "${MINGW_PACKAGE_PREFIX}-libxml2"
)
makedepends=(
  "${MINGW_PACKAGE_PREFIX}-cc"
  "${MINGW_PACKAGE_PREFIX}-meson"
  "${MINGW_PACKAGE_PREFIX}-ninja"
  "${MINGW_PACKAGE_PREFIX}-pkgconf"
)
source=("https://github.com/libxmlplusplus/libxmlplusplus/releases/download/${pkgver}/libxml++-${pkgver}.tar.xz")
sha256sums=('cd01ad15a5e44d5392c179ddf992891fb1ba94d33188d9198f9daf99e1bc4fec')

build() {
  MSYS2_ARG_CONV_EXCL="--prefix=" \
    meson setup \
      --prefix="${MINGW_PREFIX}" \
      --wrap-mode=nodownload \
      --auto-features=enabled \
      --buildtype=plain \
      -Dmaintainer-mode=false \
      "build-${MSYSTEM}" \
      "libxml++-${pkgver}"

  meson compile -C "build-${MSYSTEM}"
}

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

package() {
  meson install -C "build-${MSYSTEM}" --destdir "${pkgdir}"
}
