summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: c084d38f3d2dda616ae49808d690f4216b5aa6f8 (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
pkgname=osvr-vive-git
pkgver=r165.873f07c
pkgrel=1
pkgdesc="OSVR driver for use with the HTC Vive (including Vive PRE)"
arch=(i686 x86_64)
url="https://github.com/OSVR/OSVR-Vive"
#license=('GPL')
makedepends=('git' 'cmake')
depends=('osvr-core-git' 'openvr-git') #TODO: add more deps
source=("osvr-vive::git+https://github.com/lubosz/OSVR-Vive.git#branch=linux")
md5sums=('SKIP')

pkgver() {
  cd "$srcdir/osvr-vive"
  ( set -o pipefail
    git describe --long --tags 2>/dev/null | sed 's/\([^-]*-g\)/r\1/;s/-/./g' ||
    printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
  )
}

prepare() {
  cd osvr-vive
  # find . -name CMakeLists.txt -exec sed -i 's/jsoncpp_lib/jsoncpp/g' {} \;

  mkdir -p "$srcdir/osvr-vive-build"
  # cp "$srcdir/Findjsoncpp.cmake" "$srcdir/osvr-vive/cmake"
}

build() {
  cd osvr-vive-build
  cmake -DCMAKE_INSTALL_PREFIX=/usr/ -DCMAKE_BUILD_TYPE=Release ../osvr-vive
  make
}

package() {
  cd osvr-vive-build
  make DESTDIR="$pkgdir/" install

  mv $pkgdir/usr/lib64 $pkgdir/usr/lib

  rm $pkgdir/usr/README.md
  rm $pkgdir/usr/LICENSE

  mkdir -p $pkgdir/usr/share/osvrcore/sample-configs
  mv $pkgdir/usr/osvr_server_config.vive.sample.json $pkgdir/usr/share/osvrcore/sample-configs
}


# vim:set ts=2 sw=2 et: