aboutsummaryrefslogtreecommitdiffstats
path: root/community/py-gst/APKBUILD
blob: 7fcd7f8c1b44e30a6a0a808d9fb821cd01b04058 (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
# Contributor: Carlo Landmeter <clandmeter@gmail.com>
# Maintainer:
pkgname=py-gst
pkgver=1.16.1
pkgrel=0
pkgdesc="GStreamer Python binding"
url="https://cgit.freedesktop.org/gstreamer/gst-python/"
arch="all"
license="LGPL-2.1-or-later"
depends="py-gobject3 gst-plugins-base"
makedepends="gst-plugins-base-dev gstreamer-dev meson py-gobject3-dev
	python2-dev python3-dev"
subpackages="py2-${pkgname#py-}:_py2 py3-${pkgname#py-}:_py3"
source="https://gstreamer.freedesktop.org/src/gst-python/gst-python-$pkgver.tar.xz
	"
builddir="$srcdir/gst-python-$pkgver"

prepare() {
	default_prepare
	cp -r "$builddir" "$srcdir"/python2
	cp -r "$builddir" "$srcdir"/python3
}

build()	{
	_build python2
	_build python3
}

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

_build() {
	local python="$1"
	export PYTHON=$python
	cd "$srcdir"/$python
	meson \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var \
		-Dpython=/usr/bin/$python \
		. output
	ninja -C output
}

_py2() {
	depends="${depends//py-/py2-}"
	_py python2
}

_py3() {
	depends="${depends//py-/py3-}"
	_py python3
}

_py() {
	local python="$1"
	pkgdesc="$pkgdesc (for $python)"
	install_if="$pkgname=$pkgver-r$pkgrel $python"
	cd "$srcdir"/"$python"
	DESTDIR="$subpkgdir" ninja -C output install
}

sha512sums="333000bfe964c5d94db98990e500b7f0e12ae8c8058b306bb3a822ab13c2031ea5c55c06dd55f40c66874f879d32a15bdd4f08bcd2107e1a5bb5eb90a4572691  gst-python-1.16.1.tar.xz"