# Template file for 'python3-cffi'
pkgname=python3-cffi
version=2.1.0
revision=1
build_style=python3-pep517
hostmakedepends="python3-setuptools python3-wheel libffi-devel"
makedepends="python3-devel libffi-devel"
depends="python3-pycparser"
checkdepends="python3-pytest-xdist ${depends}"
short_desc="C foreign function interface for Python3"
maintainer="Andrew J. Hesford <ajh@sideband.org>"
license="MIT"
homepage="https://cffi.readthedocs.io/"
changelog="https://cffi.readthedocs.io/en/latest/whatsnew.html"
distfiles="${PYPI_SITE}/c/cffi/cffi-${version}.tar.gz"
checksum=efc1cdd798b1aaf39b4610bba7aad28c9bea9b910f25c784ccf9ec1fa719d1f9

do_check() {
	# glibc libm.so is a GNU ld script that isn't properly handled
	# on dlopen; libm symbols required in these tests are missing
	local excludes='not sin'
	excludes+=' and not test_dlopen'
	excludes+=' and not test_function_typedef'
	excludes+=' and not test_wraps_from_stdlib'
	excludes+=' and not test_stdcall_only_on_windows'

	PYTHONPATH="$(cd build/lib* && pwd)" \
		pytest3 src/c -n "${XBPS_MAKEJOBS}" -k "$excludes"
}

post_install() {
	vlicense LICENSE
}
