# Maintainer: Thanukamax <thanukamax@github>
pkgname=donghua-cli
pkgver=3.2.0
pkgrel=1
pkgdesc='Wuxia-themed terminal client for streaming Chinese animation'
arch=('any')
url='https://github.com/Thanukamax/donghua-cli'
license=('MIT')
depends=('python' 'python-httpx' 'python-rich' 'python-textual')
makedepends=('python-build' 'python-installer' 'python-hatchling')
optdepends=(
    'mpv: video playback (recommended)'
    'vlc: alternative video player'
    'yt-dlp: download support and fallback extraction'
    'ffmpeg: required by yt-dlp for merging streams'
)
source=("https://files.pythonhosted.org/packages/source/d/${pkgname}/${pkgname//-/_}-${pkgver}.tar.gz")
sha256sums=('fc6f2a9d1fb1542ca8f616963fdf18ef49cb363982feece6989aa432f4d0b9c8')

build() {
    cd "${pkgname//-/_}-${pkgver}"
    python -m build --wheel --no-isolation
}

package() {
    cd "${pkgname//-/_}-${pkgver}"
    python -m installer --destdir="$pkgdir" dist/*.whl
    install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}
