summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 3b612188bee60a12bb4523211c7df765877b568a (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
52
53
54
55
56
57
58
59
60
61
62
63
64
pkgname=osvr-steamvr-git
pkgver=v0.1.r342.g990f627
pkgrel=1
pkgdesc="Driver for allowing applications written against SteamVR to work with hardware and software running with the OSVR software framework."
arch=(i686 x86_64)
url="https://github.com/OSVR/SteamVR-OSVR"
#license=('GPL')
install=osvr-steamvr.install
makedepends=('git' 'cmake')
depends=('osvr-core-git' 'openvr-git' 'osvr-rendermanager-git') #TODO: add more deps
conflicts=('osvr-display-git')
source=("osvr-steamvr::git+https://github.com/OSVR/SteamVR-OSVR.git"
    "Findjsoncpp.cmake")
#options=('!strip')

pkgver() {
  cd "$srcdir/osvr-steamvr"
  ( 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-steamvr
  git submodule update --init --recursive

#https://github.com/OSVR/SteamVR-OSVR/pull/108
sed 's!osvr/display/Display.h!osvr/Display/Display.h!g' -i src/OSVRDisplay.h
sed 's!osvr/display/Display.h!osvr/Display/Display.h!g' -i src/OSVRDisplay.cpp
sed 's!osvr/display/DisplayIO.h!osvr/Display/DisplayIO.h!g' -i src/OSVRDisplay.cpp

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

build() {
  cd osvr-steamvr-build
  cmake -DCMAKE_INSTALL_PREFIX=/usr/ -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=OFF -DCMAKE_INSTALL_LIBDIR=lib ../osvr-steamvr
  make
}

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

  rm -f "$pkgdir"/usr/bin/osvr_print_displays

  # not needed and actually conflict with repo gmock and gtest
  rm -rf "$pkgdir"/usr/include/gtest/
  rm -rf "$pkgdir"/usr/include/gmock/
  rm -f "$pkgdir"/usr/lib/libgmock.a
  rm -f "$pkgdir"/usr/lib/libgmock_main.a
  rm -f "$pkgdir"/usr/lib/libgtest.a
  rm -f "$pkgdir"/usr/lib/libgtest_main.a
  rm -rf "$pkgdir"/usr/include/docopt/
  rm -rf "$pkgdir"/usr/lib/cmake/
  rm -f "$pkgdir"/usr/lib/libdocopt.a
  rm -f "$pkgdir"/usr/lib/libdocopt.so
}
md5sums=('SKIP'
         '2dd82e55b6291d32c611dd899d8a8164')

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