aboutsummaryrefslogtreecommitdiffstats
path: root/main/py-gtk/APKBUILD
blob: 48243c1f5e8858280197061cb28d5443ee3c9b66 (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
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=py-gtk
pkgver=2.24.0
pkgrel=8
pkgdesc="Python bindings for the GTK widget set"
url="http://www.pygtk.org/"
arch="all"
license="LGPL"
depends_dev="py-gobject-dev"
depends="py-cairo py-gobject"
makedepends="$depends_dev libglade-dev py-cairo-dev python-dev libffi-dev
	autoconf automake libtool"
source="http://ftp.gnome.org/pub/gnome/sources/pygtk/${pkgver%.*}/pygtk-$pkgver.tar.bz2
	pygtk-2.14.1-libdir-pc.patch
	automake.patch
	"
subpackages="$pkgname-dev $pkgname-doc $pkgname-demo"

_builddir="$srcdir"/pygtk-$pkgver
prepare() {
        local i
        cd "$_builddir"
        for i in $source; do
                case $i in
                *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
                esac
        done
	# disable pyc
	echo '#!/bin/sh' > py-compile
	libtoolize --force && aclocal -I m4 && autoconf \
		&& automake --add-missing || return 1
}

build() {
	cd "$_builddir"
	./configure --prefix=/usr || return 1
	make || return 1
}

dev() {
	default_dev
	rm -rf "$subpkgdir"/usr/lib/python*/site-packages/gtk-2.0/*.la \
		"$subpkgdir"/usr/lib/python*/site-packages/gtk-2.0/gtk/*.la
}

package() {
	cd "$_builddir"
	make DESTDIR="$pkgdir" install || return 1
	install -m644 gtk/gtk-extrafuncs.defs \
		"$pkgdir"/usr/share/pygtk/2.0/defs/ || return 1
	rm "$pkgdir"/usr/lib/python*/site-packages/gtk*/gtk/*.la \
		"$pkgdir"/usr/lib/python*/site-packages/gtk*/*.la
}

demo() {
	pkgdesc="Demonstration of pygtk"
	depends="py-gtk"
	mkdir -p "$subpkgdir"/usr/bin "$subpkgdir"/usr/lib/pygtk/2.0
	mv "$pkgdir"/usr/bin/pygtk-demo "$subpkgdir"/usr/bin/
	mv "$pkgdir"/usr/lib/pygtk/2.0/*demo* \
		"$subpkgdir"/usr/lib/pygtk/2.0/
}
md5sums="a1051d5794fd7696d3c1af6422d17a49  pygtk-2.24.0.tar.bz2
7ea85705916198f7cad29073ecd03d10  pygtk-2.14.1-libdir-pc.patch
4d32c4b66d124d48b73794841b104c74  automake.patch"