# Contributor: Leo <thinkabit.ukim@gmail.com>
# Maintainer: Will Sinatra <wpsinatra@gmail.com>
maintainer="Will Sinatra <wpsinatra@gmail.com>"
pkgname=py3-ufo2ft
pkgver=3.4.5
pkgrel=0
pkgdesc="bridge from UFOs to FontTools objects"
url="https://github.com/googlefonts/ufo2ft"
arch="noarch"
license="MIT"
depends="
	py3-booleanoperations
	py3-cffsubr
	py3-fontmath
	py3-fonttools
	py3-fs
	py3-ufolib2
	python3
	"
makedepends="
	py3-gpep517
	py3-fontmath
	py3-defcon
	py3-setuptools
	py3-setuptools_scm
	py3-wheel
	"
checkdepends="
	py3-compreffor
	py3-pytest
	py3-pytest-runner
	py3-pytest-xdist
	py3-skia-pathops
	py3-syrupy
	"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/googlefonts/ufo2ft/archive/v$pkgver.tar.gz"
builddir="$srcdir/ufo2ft-$pkgver"

case "$CARCH" in
s390x)
	options="$options !check"
	;;
esac

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

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest -n auto -p no:warnings -k \
		'not integration_test and not test_no_contour_glyphs and not kernFeatureWriter2_test'
}

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

sha512sums="
b9ea35347d528d44916957dbe75c3931071b71ad46fcc12c52d230cf1e17178780870df23ca5f030c3b17aa107fd0c14de2c343b1a8f50519147e89bbe6c6213  py3-ufo2ft-3.4.5.tar.gz
"
