# Maintainer: J. Peter Mugaas <jpmugaas@suddenlink.net>

_realname=yelp-xsl
pkgbase=mingw-w64-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}")
pkgver=42.1
pkgrel=1
pkgdesc="Stylesheets for Yelp (mingw-w64)"
arch=('any')
mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64')
url="https://www.gnome.org"
license=('GPL')
makedepends=("intltool"
             "${MINGW_PACKAGE_PREFIX}-cc"
             "${MINGW_PACKAGE_PREFIX}-itstool"
             "${MINGW_PACKAGE_PREFIX}-libxml2"
             "${MINGW_PACKAGE_PREFIX}-libxslt"
             "${MINGW_PACKAGE_PREFIX}-autotools"
             "${MINGW_PACKAGE_PREFIX}-python-mallard-ducktype")
source=(https://download.gnome.org/sources/${_realname}/${pkgver%.*}/${_realname}-${pkgver}.tar.xz)
sha256sums=('238be150b1653080ce139971330fd36d3a26595e0d6a040a2c030bf3d2005bcd')

prepare() {
  cd "${srcdir}/${_realname}-${pkgver}"
  autoreconf -ivf
}

build() {
  mkdir -p "${srcdir}"/build-${MSYSTEM} && cd "${srcdir}"/build-${MSYSTEM}

  PYTHON=${MINGW_PREFIX}/bin/python \
  ../${_realname}-${pkgver}/configure \
    --prefix=${MINGW_PREFIX} \
    --build=${MINGW_CHOST} \
    --host=${MINGW_CHOST} \
    --target=${MINGW_CHOST} \
    --sysconfdir=${MINGW_PREFIX}/etc \
    --localstatedir=${MINGW_PREFIX}/var \
    --enable-doc

  make
}

check() {
  cd "${srcdir}/build-${MSYSTEM}"
  make -k check
}

package() {
  cd "${srcdir}/build-${MSYSTEM}"
  make DESTDIR="${pkgdir}" install
  mkdir -p "${pkgdir}${MINGW_PREFIX}/lib"
  mv "${pkgdir}${MINGW_PREFIX}/share/pkgconfig" "${pkgdir}${MINGW_PREFIX}/lib/"
}
