# Contributor: Hugo Osvaldo Barrera <hugo@whynothugo.nl>
maintainer="Hugo Osvaldo Barrera <hugo@whynothugo.nl>"
pkgname=offlineimap
pkgver=8.0.0
pkgrel=2
pkgdesc="Read/sync your IMAP mailboxes"
url="https://github.com/OfflineIMAP/offlineimap3"
arch="noarch"
license="GPL-3.0-or-later"
depends="
	py3-distro
	py3-imaplib2
	py3-rfc6555
	python3
	"
makedepends="
	py3-gpep517
	py3-setuptools
	py3-wheel
	"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/OfflineIMAP/offlineimap3/archive/v$pkgver.tar.gz
	7cd32cf8-py311-compat.patch
	py312-compat.patch
	"
options="!check" # tests require an IMAP server and a Google account.
builddir="$srcdir/offlineimap3-$pkgver"

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

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

sha512sums="
7a6b7df7a366f748c80e5db7ca259eb6b83a4940fe11216e64ca11453ef41780d54e48ac24e77d3b5860de9b042bf710dde0352aae2dc518f09717b0fa9854c9  offlineimap-8.0.0.tar.gz
8d36053d650833bcf4f1830abbe582cdf843c0ed1fd4aba2da2ccbd06e45b9b4696ade0b2a8ba809afd1b6f7af9e9b7028f2d179249922b6918a14617a42dd9d  7cd32cf8-py311-compat.patch
ae61defe427e8ccd42d8fab065aeb9a031e09ea741f057db975cd32db8b3e9602b90db668e2fe56c57c79ddb489709b4473395479cf0cac8da0de3eb8ac8ee67  py312-compat.patch
"
