summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 84c9936fcd2a62758c0ba8a1a5fe1e30dc6e69d7 (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
71
# Contributor: Ionut Biru <ibiru@archlinux.org>
# Maintainer: Saeed Rasooli <saeed.gnu@gmail.com>

_pkgbase=pygobject
pkgbase=pygobject
pkgname=(python-gobject-git python2-gobject-git pygobject-devel-git)
pkgver=3.34.0+8+g15ae6328
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-cairo python2-cairo gobject-introspection git gnome-common)
optdepends=('cairo: Cairo bindings')
source=("git+https://gitlab.gnome.org/GNOME/pygobject.git")
sha256sums=('SKIP')

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

prepare() {
	mkdir -p devel
}

_build() (
	cd $_pkgbase
	python$1 setup.py build
)

build() {
	_build 2
	_build 3
}

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

	cd $_pkgbase
	python3 setup.py install --prefix="/usr/" --root="$pkgdir"
	mv "$pkgdir/usr/include/pygobject-3.0/pygobject.h" "$srcdir/devel"
	mv "$pkgdir/usr/lib/pkgconfig/pygobject-3.0.pc" "$srcdir/devel"
}

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

	cd $_pkgbase
	python2 setup.py install --prefix="/usr/" --root="$pkgdir"
	mv "$pkgdir/usr/include/pygobject-3.0/pygobject.h" "$srcdir/devel"
	mv "$pkgdir/usr/lib/pkgconfig/pygobject-3.0.pc" "$srcdir/devel"
}

package_pygobject-devel-git() {
	pkgdesc="Common development files for pygobject"
	provides=("pygobject-devel=$pkgver")
	conflicts=("pygobject-devel")

	mkdir -p "$pkgdir/usr/include/pygobject-3.0/"
	cp "$srcdir/devel/pygobject.h" "$pkgdir/usr/include/pygobject-3.0/pygobject.h"

	mkdir -p "$pkgdir/usr/lib/pkgconfig/"
	cp "$srcdir/devel/pygobject-3.0.pc" "$pkgdir/usr/lib/pkgconfig/pygobject-3.0.pc"
}