# Maintainer: Jason Nader <jason.nader [] protonmail.com>
# Maintainer: Sian1468 <sian1468-aur@.39011468.xyz>

pkgname=python-ffmpeg-progress-yield
_name=${pkgname#python-}
pkgver=1.1.3
pkgrel=1
pkgdesc="Run an ffmpeg command with its progress yielded."
arch=('any')
url="https://github.com/slhck/ffmpeg-progress-yield"
license=('MIT')
depends=('ffmpeg' 'python-tqdm' python-uv-build)
makedepends=('python-setuptools' 'python-build' 'python-installer' 'python-wheel' 'git' 'python-uv-build')
checkdepends=('ffmpeg' 'python-pytest' 'python-pytest-asyncio')
source=("git+https://github.com/slhck/ffmpeg-progress-yield.git#tag=v${pkgver}")
sha512sums=('e2d4ff5875f7281d5b8f6f38ddb3ce6236bd598ae0f88173a764daf7c7b7609d32eee045dff5811b3d8faa6826e9f595456c3c7e2ac20c2c7dc41f40878ab6d7')

function prepare() {
	cd ffmpeg-progress-yield
	sed -i 's|"uv_build>=0.8.14,<0.9.0"|"uv_build"|g' pyproject.toml
}

function build() {
	cd ffmpeg-progress-yield
	python -m build --wheel --no-isolation
}

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