From 496fe763ab0fca35550133bcd20bb3da9e3ade4a Mon Sep 17 00:00:00 2001 From: Juan RP Date: Tue, 28 Jan 2014 09:45:44 +0100 Subject: [PATCH] py2cairo: cross build support. --- srcpkgs/py2cairo/files/python-config | 9 +++++++++ srcpkgs/py2cairo/template | 20 +++++++++++++++++--- 2 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 srcpkgs/py2cairo/files/python-config diff --git a/srcpkgs/py2cairo/files/python-config b/srcpkgs/py2cairo/files/python-config new file mode 100644 index 00000000000..18a00e1a4da --- /dev/null +++ b/srcpkgs/py2cairo/files/python-config @@ -0,0 +1,9 @@ +#!/bin/sh + +# python wrapper for cross compilation in xbps +# we simply fake the output of --includes with the cross prefix. +if [ "$1" = "--includes" ]; then + echo "-I${XBPS_CROSS_BASE}/usr/include/python2.7" +fi + +return 0 diff --git a/srcpkgs/py2cairo/template b/srcpkgs/py2cairo/template index 99afada8379..0f4ed4365f2 100644 --- a/srcpkgs/py2cairo/template +++ b/srcpkgs/py2cairo/template @@ -2,8 +2,8 @@ pkgname=py2cairo version=1.10.0 revision=2 -build_style=waf -hostmakedepends="pkg-config which" +build_style=gnu-configure +hostmakedepends="automake libtool pkg-config which python-devel" makedepends="cairo-devel python-devel" depends="python" replaces="pycairo<1.10" @@ -15,9 +15,23 @@ maintainer="Juan RP " distfiles="http://cairographics.org/releases/$pkgname-$version.tar.bz2" checksum=d30439f06c2ec1a39e27464c6c828b6eface3b22ee17b2de05dc409e429a7431 +pre_configure() { + touch ChangeLog + NOCONFIGURE=1 autoreconf -fi +} + +do_configure() { + if [ "$CROSS_BUILD" ]; then + # create a python-config wrapper to fake --includes + install -m755 ${FILESDIR}/python-config ${wrksrc} + export PATH=${wrksrc}:$PATH + fi + env PYTHON=python ./configure ${configure_args} +} + py2cairo-devel_package() { replaces="pycairo-devel<1.10" - depends="python-devel ${sourcepkg}>=${version}" + depends="python-devel ${sourcepkg}>=${version}_${revision}" short_desc+=" - development files" pkg_install() { vmove usr/include