summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 335bb8dda427a9c97566422fc4039be126380793 (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
# Maintainer: jakob <grandchild@gmx.net>
# Contributor: Maarten de Vries <maarten@de-vri.es>
# Contributor: Nathan Ringo <tikiking1@gmail.com>

pkgname=libfreenect2-git
_pkgname=libfreenect2
pkgver=0.2.0.r70.gfd64c5d
pkgrel=1
pkgdesc="Open source drivers for the Kinect for Windows v2"
arch=(i686 x86_64)
url="http://openkinect.org"
license=(Apache GPL)
depends=(libusb glfw libjpeg-turbo ocl-icd)
makedepends=(cmake opencl-headers)
provides=(libfreenect2)
conflicts=(libfreenect2)
source=("git+https://github.com/OpenKinect/$_pkgname.git")
sha512sums=('SKIP')

pkgver() {
    cd "$srcdir/$_pkgname"
    git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

prepare() {
    rm -rf "$srcdir/build"
    mkdir -p "$srcdir/build"
    cd "$srcdir/build"

    sed -i -e 's/MODE="0666"/TAG+="uaccess"/' "$srcdir/$_pkgname/platform/linux/udev/90-kinect2.rules"
    sed -i -e '93aINSTALL(TARGETS Protonect DESTINATION bin)' "$srcdir/$_pkgname/examples/CMakeLists.txt"
    cmake "$srcdir/$_pkgname" \
        -DCMAKE_INSTALL_PREFIX=/usr \
        -DCMAKE_BUILD_TYPE=Release \
        -DENABLE_CXX11=ON \
        -DENABLE_OPENCL=ON \
        -DENABLE_CUDA=OFF \
        -DBUILD_EXAMPLES=ON
}

build() {
    cd "$srcdir/build"
    make
}

package() {
    cd "$srcdir/build"
    make DESTDIR="$pkgdir" install
    install -d "$pkgdir/usr/lib/udev/rules.d"
    install -m644 "$srcdir/$_pkgname/platform/linux/udev/90-kinect2.rules" "$pkgdir/usr/lib/udev/rules.d/65-kinect2.rules"
}