summaryrefslogtreecommitdiffstats
path: root/abs/core/python_modules/pygobject2/PKGBUILD
blob: bca11a082e4a34224de06a34bbde5aaa2c48ccaa (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
69
70
# $Id$
# Maintainer: Jan de Groot <jgc@archlinux.org>

pkgbase=pygobject2
pkgname=(python-gobject2 python2-gobject2 pygobject2-devel)
pkgver=2.28.7
pkgrel=1
pkgdesc="Python bindings for GObject (legacy)"
url="http://www.pygtk.org/"
arch=(x86_64)
license=(LGPL)
depends=(glib2)
makedepends=(python python2 git)
options=(!emptydirs)
_commit=c9594b6a91e6ca2086fedec2ed8249e0a9c029fc  # tags/PYGOBJECT_2_28_7^0
source=("git+https://git.gnome.org/browse/pygobject#commit=$_commit")
sha256sums=('SKIP')

pkgver() {
  cd pygobject
  git describe --tags | sed 's/^PYGOBJECT_//;s/_/./g;s/-/+/g'
}

prepare() {
  mkdir build-py{2,3} devel
  cd pygobject
  find . \( -name '*.py' -o -name '*.py.in' \) -exec sed -i '1s|python$|&2|' {} +
  autoreconf -fvi
}

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

build() {
  _build 2
  _build 3
}

package_python-gobject2() {
  depends=("pygobject2-devel=$pkgver" python)

  cd build-py3
  make DESTDIR="$pkgdir" install
  rm -r "$pkgdir"/usr/{include,lib/pkgconfig,share/pygobject/xsl}
  rm -r "$pkgdir"/usr/share/gtk-doc
}

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

  cd build-py2
  make DESTDIR="$pkgdir" install
  mv "$pkgdir"/usr/{include,lib/pkgconfig,share/pygobject/xsl} "$srcdir/devel"
  rm -r "$pkgdir"/usr/share/gtk-doc
}

package_pygobject2-devel() {
  pkgdesc="Common development files for pygobject2"

  cd devel
  mkdir -p "$pkgdir"/usr/{lib,share/pygobject}
  mv include "$pkgdir/usr/"
  mv pkgconfig "$pkgdir/usr/lib/"
  mv xsl "$pkgdir/usr/share/pygobject/"
}