# Template file for 'python3-cairo'
pkgname=python3-cairo
version=1.10.0
revision=8
nocross=yes
wrksrc="pycairo-${version}"
build_style=waf3
hostmakedepends="pkg-config python3"
makedepends="cairo-devel python3-devel"
short_desc="Python3 bindings for the cairo graphics library"
homepage="http://cairographics.org/pycairo/"
license="LGPL-3"
maintainer="Juan RP <xtraeme@voidlinux.eu>"
distfiles="http://cairographics.org/releases/pycairo-${version}.tar.bz2"
checksum=9aa4078e7eb5be583aeabbe8d87172797717f95e8c4338f0d4a17b683a7253be
replaces="python3.4-cairo>=0"

post_extract() {
	# We need to call waf to extract waflib before patching files
	python3 waf --version 1>&2 > /dev/null
	ln -s .waf3-* waf3
	cd waf3
	patch -Np1 -i ${FILESDIR}/pycairo-1.10.0-waf-py3_4.patch
	patch -Np1 -i ${FILESDIR}/pycairo-1.10.0-waf-py3_5.patch
}

python3-cairo-devel_package() {
	replaces="python3.4-cairo-devel>=0"
	depends="python3-devel ${sourcepkg}>=${version}_${revision}"
	short_desc+=" - development files"
	pkg_install() {
		vmove usr/include
		vmove usr/lib/pkgconfig
	}
}
