Date: Monday, February 14, 2011 @ 16:05:17 Author: heftig Revision: 109998
upgpkg: pygobject 2.27.90-2 Enable python 3 support and split it out Modified: pygobject/trunk/PKGBUILD ----------+ PKGBUILD | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 57 insertions(+), 10 deletions(-) Modified: PKGBUILD =================================================================== --- PKGBUILD 2011-02-14 21:05:15 UTC (rev 109997) +++ PKGBUILD 2011-02-14 21:05:17 UTC (rev 109998) @@ -1,28 +1,75 @@ # $Id$ # Maintainer: Jan de Groot <j...@archlinux.org> -pkgname=pygobject +pkgbase=pygobject +pkgname=(pygobject py3gobject pygobject-devel) pkgver=2.27.90 -pkgrel=1 -pkgdesc="Python bindings for GObject" +pkgrel=2 arch=('i686' 'x86_64') license=('LGPL') -depends=('python2' 'glib2' 'pycairo' 'gobject-introspection') -source=(http://ftp.gnome.org/pub/gnome/sources/${pkgname}/${pkgver%.*}/${pkgname}-${pkgver}.tar.bz2) +depends=('glib2' 'gobject-introspection') +makedepends=(python{,2}{,-cairo}) +source=(http://ftp.gnome.org/pub/gnome/sources/${pkgbase}/${pkgver%.*}/${pkgbase}-${pkgver}.tar.bz2) options=('!libtool') url="http://www.pygtk.org/" sha256sums=('15ad7e1a301bea13c11c55abd5736e68310c54b574ae103ef7e325fdebf44eb1') build() { - cd "${srcdir}/${pkgname}-${pkgver}" - PYTHON=python2 ./configure --prefix=/usr - make + cd "${srcdir}" + cp -a "${pkgbase}-${pkgver}" python2-build + mkdir devel + + ( + cd python2-build + export PYTHON=/usr/bin/python2 + ./configure --prefix=/usr + make + ) + + ( + cd "${pkgbase}-${pkgver}" + ./configure --prefix=/usr + make + ) } -package() { - cd "${srcdir}/${pkgname}-${pkgver}" +package_pygobject() { + pkgdesc="Python 2 bindings for GObject" + depends+=(python2{,-cairo}) + + cd "${srcdir}/python2-build" make DESTDIR="${pkgdir}" install find "$pkgdir"/usr/share/pygobject -name '*.py' | \ xargs sed -i "s|#![ ]*/usr/bin/env python$|#!/usr/bin/env python2|" + + # Delete devel stuff + rm -r "$pkgdir"/usr/{bin,include,lib/pkgconfig,share/{gtk-doc,pygobject/{2.0/codegen,xsl}}} } + +package_py3gobject() { + pkgdesc="Python 3 bindings for GObject" + depends+=(python{,-cairo}) + + cd "${srcdir}/${pkgbase}-${pkgver}" + make DESTDIR="${pkgdir}" install + + # Split devel stuff + mv "$pkgdir"/usr/{bin,include,lib/pkgconfig,share/{gtk-doc,pygobject/{2.0/codegen,xsl}}} \ + "$srcdir/devel/" +} + +package_pygobject-devel() { + pkgdesc="Development files for the pygobject bindings" + depends=(python) + + cd "${srcdir}/devel" + mkdir -p "$pkgdir"/usr/{include,lib,share/pygobject/2.0} + + mv bin "$pkgdir/usr/" + mv include "$pkgdir/usr/" + mv pkgconfig "$pkgdir/usr/lib/" + mv gtk-doc "$pkgdir/usr/share/" + mv codegen "$pkgdir/usr/share/pygobject/2.0/" + mv xsl "$pkgdir/usr/share/pygobject/" +}