aboutsummaryrefslogtreecommitdiffstats
path: root/main/py-gobject3/APKBUILD
diff options
context:
space:
mode:
authorCarlo Landmeter <clandmeter@gmail.com>2017-04-11 19:20:18 +0200
committerCarlo Landmeter <clandmeter@gmail.com>2017-04-11 19:27:04 +0200
commit5bb8b3f9f4cead2c5ce2427a4ea85d657181a84a (patch)
tree060543fecd78a023592a8fa3f3465825fb7cf6df /main/py-gobject3/APKBUILD
parent81bc97b77dde709651f305bc2898361935daa82b (diff)
downloadaports-5bb8b3f9f4cead2c5ce2427a4ea85d657181a84a.tar.gz
aports-5bb8b3f9f4cead2c5ce2427a4ea85d657181a84a.tar.bz2
aports-5bb8b3f9f4cead2c5ce2427a4ea85d657181a84a.tar.xz
main/py-gobject3: add support for py3
Diffstat (limited to 'main/py-gobject3/APKBUILD')
-rw-r--r--main/py-gobject3/APKBUILD65
1 files changed, 49 insertions, 16 deletions
diff --git a/main/py-gobject3/APKBUILD b/main/py-gobject3/APKBUILD
index eb1d49c1e7..e0d8da223a 100644
--- a/main/py-gobject3/APKBUILD
+++ b/main/py-gobject3/APKBUILD
@@ -2,40 +2,73 @@
pkgname=py-gobject3
pkgver=3.24.1
pkgrel=0
-pkgdesc="Python bindings for the GObject library"
+pkgdesc="Python bindings for the GObject library"
url="http://www.pygtk.org/"
arch="all"
license="GPL"
depends="py-cairo"
-depends_dev="libffi-dev glib-dev"
-makedepends="$depends_dev python2-dev py-cairo-dev gobject-introspection-dev"
+depends_dev="libffi-dev glib-dev"
+makedepends="$depends_dev python2-dev py-cairo-dev gobject-introspection-dev
+ python3-dev py3-cairo-dev gnome-common automake autoconf libtool"
install=
-subpackages="$pkgname-dev"
+subpackages="py2-${pkgname#py-}:_py2 py3-${pkgname#py-}:_py3 $pkgname-dev"
source="http://ftp.gnome.org/pub/GNOME/sources/pygobject/${pkgver%.*}/pygobject-$pkgver.tar.xz"
+builddir="$srcdir"/pygobject-$pkgver
-_builddir="$srcdir"/pygobject-$pkgver
prepare() {
- cd "$_builddir"
- # apply patches here
+ default_prepare
+ cp -r "$builddir" "$srcdir"/python2
+ cp -r "$builddir" "$srcdir"/python3
}
-build() {
- cd "$_builddir"
- CFLAGS="$CFLAGS -D_GNU_SOURCE" ./configure \
+build() {
+ _build python2
+ _build python3
+}
+
+package() {
+ mkdir -p "$pkgdir"
+}
+
+dev() {
+ local pkgdir="${pkgdir%/*}/py2-gobject3"
+ default_dev
+}
+
+_build() {
+ local python="$1"
+ export PYTHON=$python
+ cd "$srcdir"/$python
+ # do not include headers with py3
+ [ "$python" = "python3" ] && local _no_dev="--without-common"
+ ./configure \
--build=$CBUILD \
--host=$CHOST \
--prefix=/usr \
--sysconfdir=/etc \
--mandir=/usr/share/man \
- --infodir=/usr/share/info \
+ --localstatedir=/var \
--enable-compile-warnings=minimum \
- || return 1
- make || return 1
+ $_no_dev
+ make
}
-package() {
- cd "$_builddir"
- make DESTDIR="$pkgdir" install
+_py2() {
+ depends="${depends//py-/py2-}"
+ _py python2
+}
+
+_py3() {
+ depends="${depends//py-/py3-}"
+ _py python3
+}
+
+_py() {
+ local python="$1"
+ pkgdesc="$pkgdesc (for $python)"
+ install_if="$pkgname=$pkgver-r$pkgrel $python"
+ cd "$srcdir"/"$python"
+ make DESTDIR="$subpkgdir" install
}
sha512sums="f35968ab12b872c85af6b2410cadedcf9fa7e17352a40f3dc557c86203aa1c38753710aab9ce55e986ee2c98b64e14123c65083655445e993d0b53431db6dc93 pygobject-3.24.1.tar.xz"