# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=py3-gettext
_pkgname=gettext
pkgver=5.0
pkgrel=1
pkgdesc="Python implementation of Gettext"
url="https://github.com/hannosch/python-gettext"
arch="noarch"
license="GPL-3.0-or-later"
makedepends="py3-setuptools"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/hannosch/python-gettext/archive/$pkgver.tar.gz"
builddir="$srcdir/python-$_pkgname-$pkgver"

replaces="py-gettext" # Backwards compatibility
provides="py-gettext=$pkgver-r$pkgrel" # Backwards compatibility

# some files are generated incorrectly
case "$CARCH" in
s390x) options="$options !check"
esac

build() {
	python3 setup.py build
}

check() {
	PYTHONPATH=build/lib python3 -m unittest discover -s src/pythongettext
}

package() {
	python3 setup.py install --skip-build --root="$pkgdir"
}

sha512sums="
87a1ff704aa43b495bfecf13f6a1ef95383a81c29c8044c670b25d245b666fd42942ad53cc866177e371661d1f9e75daefd9bddd76436cd3a151b27ada2122ec  py3-gettext-5.0.tar.gz
"
