# Template file for 'alot'
pkgname=alot
version=0.11
revision=2
build_style=python3-pep517
hostmakedepends="python3-setuptools_scm python3-Sphinx
 python3-notmuch2 python3-cffi python3-importlib_metadata"
depends="python3-Twisted python3-notmuch2 python3-configobj
 gpgme-python3 python3-magic python3-urwidtrees python3-urwid"
checkdepends="$depends gnupg2 procps-ng python3-pytest"
short_desc="Terminal-based mail user agent based on the notmuch mail indexer"
maintainer="Felix Van der Jeugt <felix.vanderjeugt@posteo.net>"
license="GPL-3.0-or-later"
homepage="https://github.com/pazz/alot"
distfiles="https://github.com/pazz/${pkgname}/archive/${version}.tar.gz"
checksum=4b82a38af65bea84719c40a01f4c1edc759263f7a752e1f1b3457e72ef7b0a2d
export SETUPTOOLS_SCM_PRETEND_VERSION_FOR_alot=$version

post_patch() {
	sed -i "s/importlib.metadata.version.*/'$version'/" docs/source/conf.py
}

do_check() {
	pytest3 -k 'not test_no_spawn_no_stdin_attached'
}

post_build() {
	make $makejobs -C docs man
}

post_install() {
	vman docs/build/man/alot.1
}
