1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
6 PYTHON_DEPEND="python? 2:2.6"
8 inherit cmake-utils multilib python
10 DESCRIPTION="Drivers and libraries for the Xbox Kinect device"
11 HOMEPAGE="https://github.com/OpenKinect/libfreenect"
12 SRC_URI="https://github.com/OpenKinect/${PN}/tarball/v${PV} -> ${P}.tar.gz"
16 KEYWORDS="~amd64 ~x86"
17 IUSE="c_sync examples fakenect opencv python"
18 REQUIRED_USE="opencv? ( c_sync )
21 RDEPEND="virtual/libusb:1
26 opencv? ( media-libs/opencv )
29 >=dev-python/cython-0.14.1-r1
36 mv OpenKinect-${PN}-* ${P} || die
41 python_set_active_version 2
48 $(cmake-utils_use_build c_sync)
49 $(cmake-utils_use_build examples)
50 $(cmake-utils_use_build examples CPP)
51 $(cmake-utils_use_build fakenect)
52 $(cmake-utils_use_build opencv CV)
53 $(cmake-utils_use_build python)
55 cmake-utils_src_configure
59 cmake-utils_src_install
60 # Rename record example so it does not collide with xawtv
61 if use examples && use fakenect; then
62 mv "${D}"/usr/bin/record "${D}"/usr/bin/frecord || die
64 # Remove cvdemo if examples is not enabled
65 if use opencv && ! use examples; then
66 rm -f "${D}"/usr/bin/cvdemo || die
68 insinto /$(get_libdir)/udev/rules.d/
69 doins "${FILESDIR}/51-kinect.rules"
73 elog "Make sure your user is in the 'video' group"
74 elog "Just run 'gpasswd -a <USER> video', then have <USER> re-login."