]> Pileus Git - ~andy/sunrise/blob - dev-libs/libfreenect/libfreenect-0.1.2-r1.ebuild
app-dicts/words-bin: Adding ~amd64 keyword
[~andy/sunrise] / dev-libs / libfreenect / libfreenect-0.1.2-r1.ebuild
1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: $
4
5 EAPI="4"
6 PYTHON_DEPEND="python? 2:2.6"
7
8 inherit cmake-utils multilib python
9
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"
13
14 LICENSE="GPL-2"
15 SLOT="0"
16 KEYWORDS="~amd64 ~x86"
17 IUSE="c_sync examples fakenect opencv python"
18 REQUIRED_USE="opencv? ( c_sync )
19         python? ( c_sync )"
20
21 RDEPEND="virtual/libusb:1
22         examples? (
23                 media-libs/freeglut
24                 virtual/opengl
25         )
26         opencv? ( media-libs/opencv )
27         python? (
28                 dev-python/numpy
29                 >=dev-python/cython-0.14.1-r1
30         )"
31 DEPEND="${RDEPEND}
32         virtual/pkgconfig"
33
34 src_unpack() {
35         unpack ${A}
36         mv OpenKinect-${PN}-* ${P} || die
37 }
38
39 pkg_setup() {
40         if use python; then
41                 python_set_active_version 2
42                 python_pkg_setup
43         fi
44 }
45
46 src_configure() {
47         local mycmakeargs=(
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)
54         )
55         cmake-utils_src_configure
56 }
57
58 src_install() {
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
63         fi
64         # Remove cvdemo if examples is not enabled
65         if use opencv && ! use examples; then
66                 rm -f "${D}"/usr/bin/cvdemo || die
67         fi
68         insinto /$(get_libdir)/udev/rules.d/
69         doins "${FILESDIR}/51-kinect.rules"
70 }
71
72 pkg_postinst() {
73         elog "Make sure your user is in the 'video' group"
74         elog "Just run 'gpasswd -a <USER> video', then have <USER> re-login."
75 }