# Template file for 'streamlink'
pkgname=streamlink
version=0.10.0
revision=1
noarch=yes
build_style=python3-module
pycompile_module="streamlink streamlink_cli"
hostmakedepends="python3-setuptools"
checkdepends="python3-crypto python3-pycountry python3-pysocks python3-websocket-client
python3-pytest python3-requests"
depends="python3-setuptools python3-requests python3-crypto python3-pycountry
 python3-pysocks python3-websocket-client"
short_desc="Utility extracting streams from services, forked from livestreamer"
maintainer="wkuipers <wietse@kuiprs.nl>"
license="2-clause-BSD"
homepage="https://streamlink.github.io/"
distfiles="https://github.com/streamlink/streamlink/releases/download/${version}/streamlink-${version}.tar.gz"
checksum=8bc06e53ab15fab57f782ea438a5f00c4807148b21f8fbed9238ed4865e08e24

export STREAMLINK_USE_PYCRYPTO=1
export STREAMLINK_USE_PYCOUNTRY=1

do_check() {
	# in python3 mock is unittest.mock
	sed -i 's|mock|unittest.mock|g' tests/test_stream_streamprocess.py

	PYTHONPATH="${PWD}/build/lib" python3 -m pytest
}

post_install() {
	vlicense LICENSE
}
