# Maintainer: Frederik Schwan <freswa at archlinux dot org>
# Contributor: Hao Long <imlonghao@archlinuxcn.org>

pkgname=python-rich
pkgver=15.0.0
pkgrel=1
pkgdesc='Python library for rich text and beautiful formatting in the terminal'
arch=(any)
url='https://github.com/Textualize/rich'
license=(MIT)
depends=(python python-{markdown-it-py,pygments})
makedepends=(git python-{build,installer,poetry-core,wheel})
source=("$pkgname::git+https://github.com/Textualize/rich#tag=v$pkgver")
sha512sums=('5a1f65176c890b8ccb6ccc5e3657a7f635720826ac9f4472b63e585a155deb47db188a9179ae150a96aff8fdb1779c46e1679d1f39b7d464c80794ac1b76c0aa')
b2sums=('abfe662f0e1c0d1dbf4957ce55d8f481dbd3e55f38056cdbd77b0cc5fc42b0619f623ee707dfc0e3039c30b727c80ba00d1599a9fb48a3319fba142db4fba74f')

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
}
