aboutsummaryrefslogtreecommitdiffstats
path: root/main/py-gobject3/APKBUILD
blob: befbf343a0a7d0ed12bc8ecff99d8b1e0a87a9cf (plain) (blame)
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.1
pkgrel=0
pkgdesc="Python bindings for the GObject library"
url="https://www.pygtk.org/"
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="5b325d0caf4f34f783fc2c664a795809f048eb1639d2f2e375fc147c852d6e29a8ab119438cac76786fb20220c72d5859cc06d6f70c29f976f6a5914e0169915  pygobject-3.32.1.tar.xz"