aboutsummaryrefslogtreecommitdiffstats
path: root/community/libcec/APKBUILD
blob: 1d789c6fe960b7172c18ae52890b8c70ea80244c (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
# Contributor: Róbert Nagy <vrnagy@gmail.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=libcec
pkgver=4.0.2
pkgrel=1
pkgdesc="libcec for the Pulse-Eight USB-CEC adapter"
url="https://github.com/Pulse-Eight/libcec"
arch="all"
license="GPL"
depends=""
depends_dev="eudev-dev python3-dev libxrandr-dev swig"
makedepends="$depends_dev p8-platform-dev cmake"
install=""
subpackages="$pkgname-dev"
source="https://github.com/Pulse-Eight/libcec/archive/libcec-$pkgver.tar.gz"

builddir="$srcdir"/libcec-libcec-$pkgver

prepare() {
	default_prepare
	# remove non linux binaries
	cd "$builddir"
	rm -r support
}

build() {
	mkdir "$builddir/build"
	cd "$builddir/build"
	cmake -DCMAKE_BUILD_TYPE=Release \
		-DBUILD_SHARED_LIBS=1 \
		-DCMAKE_INSTALL_PREFIX=/usr \
		.. || return 1
	make || return 1
}

package() {
	cd "$builddir/build"
	make DESTDIR="$pkgdir" install || return 1

	# Add cec directory to sys.path to get rid of issue https://github.com/Pulse-Eight/libcec/issues/316
	python_dir=$(python3 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")
	echo "cec" > "${pkgdir}${python_dir}/cec.pth"
}

md5sums="47892140fbda566f6a6f944b52eb44fd  libcec-4.0.2.tar.gz"
sha256sums="b8b8dd31f3ebdd5472f03ab7d401600ea0d959b1288b9ca24bf457ef60e2ba27  libcec-4.0.2.tar.gz"
sha512sums="7bb80965cd1bef713f59bff136dc4a7f1172c4a9bdb8e2f59c6bcc5b74110848c0b2912263280ea68177908a688127e8d7208fc43ce6e65d589343b85395a0bb  libcec-4.0.2.tar.gz"