1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 PYTHON_COMPAT=( python{2_7,3_6} )
10 inherit cmake-utils linux-info python-single-r1 toolchain-funcs
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"
18 KEYWORDS="amd64 ~arm x86"
19 IUSE="cubox exynos python raspberry-pi +xrandr"
20 REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
23 >=dev-libs/libplatform-2.0.0
25 raspberry-pi? ( >=media-libs/raspberrypi-userland-0_pre20160305-r1 )
26 xrandr? ( x11-libs/libXrandr )
27 python? ( ${PYTHON_DEPS} )"
29 python? ( dev-lang/swig )
32 CONFIG_CHECK="~USB_ACM"
34 S="${WORKDIR}/${PN}-${MY_P}"
36 PATCHES=( "${FILESDIR}/${P}-no-tinfo.patch" )
44 use python && python-single-r1_pkg_setup
48 cmake-utils_src_prepare
50 # Do not hardcode the python libpath #577612
52 -e '/DESTINATION/s:lib/python${PYTHON_VERSION}/dist-packages:${PYTHON_SITEDIR}:' \
53 src/libcec/cmake/CheckPlatformSupport.cmake || die
55 use python || cmake_comment_add_subdirectory "src/pyCecClient"
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)
65 use python && mycmakeargs+=(
66 -DPYTHON_SITEDIR="$(python_get_sitedir)"
69 # raspberrypi-userland itself does not provide .pc file so using
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)
76 cmake-utils_src_configure
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"