aboutsummaryrefslogtreecommitdiffstats
path: root/main/py-gobject3/APKBUILD
blob: ba3a9ff8c9467e094c6cf911c816d767afae4d06 (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
# Contributor: Rasmus Thomsen <oss@cogitri.dev>
# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Maintainer: Rasmus Thomsen <oss@cogitri.dev>
pkgname=py-gobject3
pkgver=3.32.2
pkgrel=0
pkgdesc="Python bindings for the GObject library"
url="https://wiki.gnome.org/Projects/PyGObject/"
arch="all"
license="LGPL-2.1-or-later"
makedepends="python2-dev python3-dev py-cairo-dev gobject-introspection-dev
	libffi-dev glib-dev meson"
checkdepends="py2-pytest py3-pytest gtk+3.0-dev xvfb-run"
options="!check" # xvfb-run is in community/ still
subpackages="py2-${pkgname#py-}:_py2 py3-${pkgname#py-}:_py3 $pkgname-dev"
source="https://download.gnome.org/sources/pygobject/${pkgver%.*}/pygobject-$pkgver.tar.xz"
builddir="$srcdir"/pygobject-$pkgver

build()	{
	_build python2
	_build python3
}

check() {
	xvfb-run ninja -C python2 test
	xvfb-run ninja -C python3 test
}

package() {
	mkdir -p "$pkgdir"
}

_build() {
	local python="$1"
	meson \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var \
		--buildtype=release \
		-Dpython=$python \
		. "$python"

	ninja -C "$python"
}

_py2() {
	depends="py2-cairo"
	_py python2
}

_py3() {
	depends="py3-cairo"
	_py python3
}

_py() {
	local python="$1"
	pkgdesc="$pkgdesc (for $python)"
	install_if="$pkgname=$pkgver-r$pkgrel $python"

	DESTDIR="$pkgdir" ninja -C "$builddir"/$python install
	mkdir -p "$subpkgdir"/usr/lib
	mv "$pkgdir"/usr/lib/${python}.* "$subpkgdir"/usr/lib/
}

sha512sums="50081bfed45e8b5f0b87fe5c95d4cc12d1b31085e869c603bbc70e34bca69059cc44e8a42270f51e7f04e3ecf2c98da524327a982ed7bb594621fb434d4227f6  pygobject-3.32.2.tar.xz"