# Maintainer: Alberto Fanjul Alonso <albfan@gnome.org>

_realname=gtk-elementary-theme
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=8.2.0
pkgrel=1
arch=('any')
mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64')
msys2_references=(
  'archlinux: gtk-theme-elementary'
)
pkgdesc="The GTK Stylesheet for elementary OS"
optdepends=("${MINGW_PACKAGE_PREFIX}-gtk-engine-murrine: gtk2 theme support")
makedepends=("${MINGW_PACKAGE_PREFIX}-meson"
             "${MINGW_PACKAGE_PREFIX}-sassc"
             "${MINGW_PACKAGE_PREFIX}-cc"
             "${MINGW_PACKAGE_PREFIX}-gettext-tools"
             "${MINGW_PACKAGE_PREFIX}-pkgconf"
             "git")
license=("spdx:GPL-3.0-or-later")
url="https://github.com/elementary/stylesheet"
source=(${_realname}-${pkgver}::git+https://github.com/elementary/stylesheet.git#tag=${pkgver})
sha256sums=('0173a61b87f850efc2c608b2fd4e1bffb5969f404c03506ba597bec46400ce02')

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

  MSYS2_ARG_CONV_EXCL="--prefix=" \
  ${MINGW_PREFIX}/bin/meson.exe setup \
    --prefix="${MINGW_PREFIX}" \
    --buildtype plain \
    --wrap-mode nodownload \
    ../${_realname}-${pkgver}

  ${MINGW_PREFIX}/bin/meson.exe compile
}

package() {
  cd "$srcdir/build-${MSYSTEM}"
  ${MINGW_PREFIX}/bin/meson.exe install --destdir="${pkgdir}"

  install -Dm644 "${srcdir}/${_realname}-${pkgver}/COPYING" "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/COPYING"
}
