sys-process/glances: 3.1.4.1-r1 amd64 stable, bug #720368
[gentoo.git] / dev-libs / libcec / libcec-4.0.2-r2.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 PYTHON_COMPAT=( python3_6 )
7 MY_PV=${PV/_p/-}
8 MY_P=${PN}-${MY_PV}
9
10 inherit cmake-utils linux-info python-single-r1 toolchain-funcs
11
12 DESCRIPTION="Library for communicating with the Pulse-Eight USB HDMI-CEC Adaptor"
13 HOMEPAGE="http://libcec.pulse-eight.com"
14 SRC_URI="https://github.com/Pulse-Eight/${PN}/archive/${MY_P}.tar.gz"
15
16 LICENSE="GPL-2"
17 SLOT="0"
18 KEYWORDS="amd64 ~arm x86"
19 IUSE="cubox exynos python raspberry-pi +xrandr"
20 REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
21
22 RDEPEND="virtual/udev
23         >=dev-libs/libplatform-2.0.0
24         sys-libs/ncurses:=
25         raspberry-pi? ( >=media-libs/raspberrypi-userland-0_pre20160305-r1 )
26         xrandr? ( x11-libs/libXrandr )
27         python? ( ${PYTHON_DEPS} )"
28 DEPEND="${RDEPEND}
29         python? ( dev-lang/swig )
30         virtual/pkgconfig"
31
32 CONFIG_CHECK="~USB_ACM"
33
34 S="${WORKDIR}/${PN}-${MY_P}"
35
36 PATCHES=( "${FILESDIR}/${P}-no-tinfo.patch" )
37
38 pkg_pretend() {
39         linux-info_pkg_setup
40 }
41
42 pkg_setup() {
43         linux-info_pkg_setup
44         use python && python-single-r1_pkg_setup
45 }
46
47 src_prepare() {
48         cmake-utils_src_prepare
49
50         # Do not hardcode the python libpath #577612
51         sed -i \
52                 -e '/DESTINATION/s:lib/python${PYTHON_VERSION}/dist-packages:${PYTHON_SITEDIR}:' \
53                 src/libcec/cmake/CheckPlatformSupport.cmake || die
54
55         use python || cmake_comment_add_subdirectory "src/pyCecClient"
56 }
57
58 src_configure() {
59         local mycmakeargs=(
60                 -DSKIP_PYTHON_WRAPPER=$(usex !python)
61                 -DHAVE_EXYNOS_API=$(usex exynos)
62                 -DHAVE_TDA995X_API=$(usex cubox)
63                 -DHAVE_RPI_API=$(usex raspberry-pi)
64         )
65         use python && mycmakeargs+=(
66                 -DPYTHON_SITEDIR="$(python_get_sitedir)"
67         )
68
69         # raspberrypi-userland itself does not provide .pc file so using
70         # bcm_host.pc instead
71         use raspberry-pi && mycmakeargs+=(
72                 -DRPI_INCLUDE_DIR=$( $(tc-getPKG_CONFIG) --variable=includedir bcm_host) \
73                 -DRPI_LIB_DIR=$( $(tc-getPKG_CONFIG) --variable=libdir bcm_host)
74         )
75
76         cmake-utils_src_configure
77 }
78
79 pkg_postinst() {
80         elog "You will need to ensure the user running your CEC client has"
81         elog "read/write access to the device. You can ensure this by adding"
82         elog "them to the uucp group"
83 }