aboutsummaryrefslogtreecommitdiff
blob: c1e576cef5754c36de0e3b8b693a823f8f945c93 (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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# Copyright 1999-2021 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

EAPI=7

inherit git-r3 cmake systemd

DESCRIPTION="An opensource 'AmbiLight' implementation (next generation)"
HOMEPAGE="https://hyperion-project.org/"
SRC_URI=""
EGIT_REPO_URI="https://github.com/hyperion-project/${PN}.ng"
EGIT_SUBMODULES=()

if [[ ${PV} != 9999 ]]; then
	MY_PV="${PV/_/-}"
	MY_PV="${MY_PV/alpha9/alpha.9}"
	EGIT_COMMIT="${MY_PV}"
fi

LICENSE="MIT"
SLOT="0"
KEYWORDS=""
IUSE="cec +spi tinkerforge +qt-grabber +usb +v4l +xcb +zeroconf"

# currently only platform x11 is supported
# TODO extend for rpi amlogic amlogic64

DEPEND="
	dev-lang/python
	dev-libs/protobuf
	dev-qt/qtcore:5
	dev-qt/qtgui:5
	dev-qt/qtnetwork:5
	dev-qt/qtserialport:5
	dev-qt/qtsql:5
	dev-qt/qtsvg:5
	dev-qt/qtx11extras:5
	dev-libs/flatbuffers
	dev-util/cmake
	net-libs/mbedtls
	dev-libs/openssl
	sys-libs/zlib
	sys-apps/dbus
	v4l? ( virtual/jpeg )
	zeroconf? ( net-dns/avahi[mdnsresponder-compat] )
	cec? ( dev-libs/libcec )
	xcb? (
		x11-libs/xcb-util-image
		x11-libs/libxcb
		x11-libs/xcb-util
		x11-libs/xcb-util-renderutil
		x11-libs/libXrandr
		x11-libs/libXrender
	)
	usb? ( virtual/libusb )
"
RDEPEND="
	acct-user/hyperion
	${DEPEND}
"

PATCHES=(
	"${FILESDIR}"/0001-Proto-fix-Error-macro-conflict.patch
	"${FILESDIR}"/0001-CMake-prevent-lib-copies-for-package-creation.patch
	"${FILESDIR}"/0001-Cmake-fix-rpath.patch
)

src_configure() {
	local mycmakeargs=(
		-DCMAKE_BUILD_TYPE=Release
		-DPLATFORM=x11
		-DBUILD_SHARED_LIBS=off
		-DENABLE_AMLOGIC=off
		-DENABLE_OSX=off
		-DENABLE_X11=on
		-DENABLE_EXPERIMENTAL=off
		-DENABLE_DISPMANX=off # rpi lib
		-DENABLE_DX=off # DirectX
		-DENABLE_PROFILER=off # DirectX
		-DENABLE_WS281XPWM=off # rpi lib
		-DENABLE_FB=on
		-DENABLE_QT=$(usex qt-grabber)
		-DENABLE_TINKERFORGE=$(usex tinkerforge)
		-DENABLE_XCB=$(usex xcb)
		-DENABLE_AVAHI=$(usex zeroconf)
		-DENABLE_CEC="$(usex cec)"
		-DENABLE_SPIDEV="$(usex spi)"
		-DENABLE_USB_HID="$(usex usb)"
		-DENABLE_V4L2="$(usex v4l)"
		-DUSE_SYSTEM_PROTO_LIBS=on
		-DUSE_SYSTEM_FLATBUFFERS_LIBS=on
		-DUSE_SYSTEM_MBEDTLS_LIBS=on
		-DUSE_SHARED_AVAHI_LIBS=on
		-Wno-dev
	)
	cmake_src_configure
}

src_install() {
	cmake_src_install

	insinto /etc/hyperion
	doins "${S}/config/hyperion.config.json.default"
	doins "${S}/config/hyperion.config.json.commented"
	ewarn "An example config file is provided in /etc/hyperion."
	ewarn "To allow access to certain input devices you have add the hyperion"
	ewarn "user to the uucp group: usermod -G uucp hyperion"

	newinitd "${FILESDIR}"/hyperion.initd hyperion
	systemd_newunit "${S}/bin/service/hyperion.systemd" hyperion.service
}