maintainer="Hoang Nguyen <folliekazetani@protonmail.com>"
pkgname=gallery-dl
pkgver=1.27.7
pkgrel=0
pkgdesc="CLI tool to download image galleries"
url="https://github.com/mikf/gallery-dl"
arch="noarch"
license="GPL-2.0-or-later"
depends="py3-requests python3"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
checkdepends="py3-pytest yt-dlp"
subpackages="
	$pkgname-doc
	$pkgname-pyc
	$pkgname-bash-completion
	$pkgname-zsh-completion
	$pkgname-fish-completion
	"
source="$pkgname-$pkgver.tar.gz::https://github.com/mikf/gallery-dl/archive/v$pkgver.tar.gz
	fix-yt_dlp-attribute-error.patch::https://github.com/mikf/gallery-dl/commit/00fe1c81b2721eb765fbe78003d92ad6ab339c68.patch
	disable-type-error-test.patch
	"

build() {
	make man completion

	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	make test
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
384c5a5c7dfac01ad48dbbe12750e5bec5814620bebd1d49866a9a3b6d64f7aac60e4173f737ed2678c6d57e372b6957cb747d28444981a4ddb7721bd4f9cff9  gallery-dl-1.27.7.tar.gz
4df1d7d004d46163ee93488ac8784e329f00319c541ee2407dc831f4be86eb47c93f014b734c49a5cfc5fed6e9ff64d3747671b828141a644f6d66c68ecad088  fix-yt_dlp-attribute-error.patch
2c5117d7c15900744ead754f165933da7e7968a6adc4290e4f41284f75825354590fee09dc7d006d2f5b7ed3e755e76c5623054439dbbd4376b1edd9ed37188c  disable-type-error-test.patch
"
