summaryrefslogtreecommitdiffstats
path: root/abs/core/python_modules/pygobject/PKGBUILD
blob: ba196daec547de95b8e632687d0b7e97b14fa466 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# $Id$
# Contributor: Ionut Biru <ibiru@archlinux.org>

pkgbase=pygobject
pkgname=(python-gobject python2-gobject pygobject-devel)
pkgver=3.26.1
pkgrel=1
pkgdesc="Python Bindings for GLib/GObject/GIO/GTK+"
url="https://wiki.gnome.org/Projects/PyGObject"
arch=(x86_64)
license=(LGPL)
depends=(gobject-introspection-runtime)
makedepends=(python{,2}-cairo gobject-introspection git autoconf-archive)
optdepends=('cairo: Cairo bindings')
_commit=55cb08b71cd23f56b97d912af22ca24e787fd5d7  # tags/3.26.1^0
source=("git+https://git.gnome.org/browse/pygobject#commit=$_commit")
sha256sums=('SKIP')

pkgver() {
  cd $pkgbase
  git describe --tags | sed 's/-/+/g'
}

prepare() {
  mkdir build-py{2,3} devel
  cd $pkgbase
  NOCONFIGURE=1 ./autogen.sh
}

_build() (
  cd build-py$1
  ../$pkgbase/configure --prefix=/usr --with-python=/usr/bin/python$1
  sed -i 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
  make
)

build() {
  _build 2
  _build 3
}

package_python-gobject() {
  depends=("pygobject-devel=$pkgver" python)

  cd build-py3
  make DESTDIR="$pkgdir" install
  mv "$pkgdir"/usr/{include,lib/pkgconfig} "$srcdir/devel"
}

package_python2-gobject() {
  pkgdesc="${pkgdesc/Python/Python2}"
  depends=("pygobject-devel=$pkgver" python2)

  cd build-py2
  make DESTDIR="$pkgdir" install
  python2 -m compileall "$pkgdir"/usr/lib/python2.7/site-packages/gi
  rm -r "$pkgdir"/usr/{include,lib/pkgconfig}
}

package_pygobject-devel() {
  pkgdesc="Common development files for pygobject"
  optdepends=()

  cd devel
  mkdir -p "$pkgdir/usr/lib"
  mv include "$pkgdir/usr/"
  mv pkgconfig "$pkgdir/usr/lib/"
}