summaryrefslogtreecommitdiff
path: root/testing/py3-pyatem/APKBUILD
blob: 3be59e0f7f1e1949279a11b36330f7aff1250041 (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
72
73
# Maintainer: Martijn Braam <martijn@brixit.nl>
# Contributor: Martijn Braam <martijn@brixit.nl>
pkgname=py3-pyatem
pkgver=0.5.0
pkgrel=1
pkgdesc="Python library for controlling Blackmagic Design ATEM hardware"
url="https://git.sr.ht/~martijnbraam/pyatem"
arch="all"
license="LGPL-3.0-only"
source="$pkgname-$pkgver.tar.gz::https://git.sr.ht/~martijnbraam/pyatem/archive/$pkgver.tar.gz
	openswitcher-proxy.confd
	openswitcher-proxy.initd
	"
depends="python3 py3-usb py3-zeroconf"
makedepends="py3-setuptools python3-dev glib-dev libhandy1-dev meson"
checkdepends="py3-pytest"
builddir="$srcdir/pyatem-$pkgver"
subpackages="openswitcher openswitcher-proxy:proxy openswitcher-proxy-openrc"

build() {
	# Build the python library
	python3 setup.py build

	# Build the native code in-place for the tests
	python3 setup.py build_ext --inplace

	# Build the GTK app
	abuild-meson -Dwith_proxy=False . output_gtk
	meson compile ${JOBS:+-j ${JOBS}} -C output_gtk

	# Build the proxy daemon
	abuild-meson -Dwith_gtk_app=False . output_proxy
	meson compile ${JOBS:+-j ${JOBS}} -C output_proxy
}

check() {
	pytest
}

package() {
	python3 setup.py install --skip-build --root="$pkgdir"

	install -D -m644 "$builddir"/100-blackmagicdesign.rules \
		"$pkgdir"/lib/udev/rules.d/100-blackmagicdesign.rules
}

openswitcher() {
	pkgdesc="GTK+3 Control application for Blackmagic Design ATEM hardware"
	depends="python3 py3-gobject3 gtk+3.0 libhandy1-dev py3-pyatem py3-cairo"

	DESTDIR="$subpkgdir" meson install --no-rebuild -C "$builddir"/output_gtk
	install -D -m755 "$srcdir"/openswitcher-proxy.initd \
		"$pkgdir"/etc/init.d/openswitcher-proxy
	install -D -m644 "$srcdir"/openswitcher-proxy.confd \
		"$pkgdir"/etc/conf.d/openswitcher-proxy
}

proxy() {
	pkgdesc="Reverse proxy for the Blackmagic Design ATEM protocol"
	depends="python3 py3-pyatem py3-toml py3-paho-mqtt"
	install="openswitcher-proxy.pre-install"

	DESTDIR="$subpkgdir" meson install --no-rebuild -C "$builddir"/output_proxy

	install -D -m644 "$builddir"/proxy-full.toml \
		"$pkgdir"/etc/openswitcher/proxy.toml.example
}

sha512sums="
54db7562c9f85fc0f272949e34ec5b16b3a061af96651cbb491bb735aeaacc794d3e07f744a59be9e3c77f45bd8bbf6de6c7b6428b9ed953f9408040a50e953e  py3-pyatem-0.5.0.tar.gz
f7d60a2b4effb5795fedfde6c2d9f7523847530d933af73b275642c2b6afd254fe0f189f9a5c304544f1b2be3f79db88404a8d6d0a5a26ce1f5b5d3375eea858  openswitcher-proxy.confd
a0e337e9b337825b6f23bf43fd9fe700bebf32e9747f2ddd92383a6a4a7f9da14151744af03f3c80c997d96dc9ce767f198cf18460ccf93828e6d1cd519fe50f  openswitcher-proxy.initd
"