# Maintainer: George Rawlinson <grawlinson@archlinux.org>

pkgname=python-qt-material
pkgver=2.12.r4.g1f73d3d
pkgrel=2
pkgdesc='Material inspired stylesheet for PySide & PyQt'
arch=('any')
url='https://qt-material.readthedocs.io/'
license=('BSD' 'Apache')
depends=('python-jinja')
makedepends=(
  'git'
  'python-build'
  'python-installer'
  'python-wheel'
  'python-setuptools'
)
_commit='1f73d3de269b09e493400615437c6c30b46be110'
source=("$pkgname::git+https://github.com/UN-GCPDS/qt-material#commit=$_commit")
b2sums=('SKIP')

pkgver() {
  cd "$pkgname"

  # first known commit to receive latest version
  local _pkgver='2.12'
  local _pkgcommit='097bd2a06794b5ce0010f3209f26ea09df267c78'

  git tag "$_pkgver" "$_pkgcommit"

  git describe --tags | sed -e 's/^v//' -e 's/-/.r/' -e 's/-/./g'
}

build() {
  cd "$pkgname"

  python -m build --wheel --no-isolation
}

package() {
  cd "$pkgname"

  python -m installer --destdir="$pkgdir" dist/*.whl

  # license
  install -vDm644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE
}
