summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Haag2015-07-29 18:08:52 +0200
committerChristoph Haag2015-07-29 18:09:57 +0200
commitcd569f818436773d5e67c025cab57c5cd2810495 (patch)
treeeb8d504700d31522d84a17c117a3108ddd98325c
downloadaur-cd569f818436773d5e67c025cab57c5cd2810495.tar.gz
initial commit
-rw-r--r--.SRCINFO19
-rw-r--r--Findjsoncpp.cmake111
-rw-r--r--PKGBUILD50
-rw-r--r--osvr-steamvr.install13
4 files changed, 193 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..67b591d6e591
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,19 @@
+pkgbase = osvr-steamvr-git
+ pkgdesc = Driver for allowing applications written against SteamVR to work with hardware and software running with the OSVR software framework.
+ pkgver = steamvr.r33.gda5a506
+ pkgrel = 1
+ url = https://github.com/OSVR/SteamVR-OSVR
+ install = osvr-steamvr.install
+ arch = i686
+ arch = x86_64
+ makedepends = git
+ makedepends = cmake
+ depends = osvr-core-git
+ depends = openvr-git
+ source = osvr-steamvr::git+https://github.com/OSVR/SteamVR-OSVR.git
+ source = Findjsoncpp.cmake
+ md5sums = SKIP
+ md5sums = 2dd82e55b6291d32c611dd899d8a8164
+
+pkgname = osvr-steamvr-git
+
diff --git a/Findjsoncpp.cmake b/Findjsoncpp.cmake
new file mode 100644
index 000000000000..8b0a88e56ba3
--- /dev/null
+++ b/Findjsoncpp.cmake
@@ -0,0 +1,111 @@
+########################################################################
+# Cmake module for finding JsonCpp
+#
+# The following variabled will be defined:
+#
+# JsonCpp_FOUND
+# JsonCpp_INCLUDE_DIR
+# JsonCpp_LIBRARY
+#
+
+# ----------------------------------------------------------------------
+# Find JsonCpp include path
+# ----------------------------------------------------------------------
+FIND_PATH(JsonCpp_INCLUDE_DIR
+ NAMES
+ json/json.h
+ PATHS
+ ${LibSourcey_DEPENDENCIES_SOURCE_DIR}/jsoncpp
+ ${LibSourcey_DEPENDENCIES_SOURCE_DIR}/jsoncpp/include
+ #/usr/local/include
+ #/usr/include
+)
+
+# ----------------------------------------------------------------------
+# Find JsonCpp library
+# ----------------------------------------------------------------------
+if(WIN32 AND MSVC)
+
+ find_library(JsonCpp_DEBUG_LIBRARY
+ NAMES
+ jsoncppd
+ PATHS
+ ${LibSourcey_DEPENDENCIES_BUILD_DIR}/jsoncpp
+ ${LibSourcey_DEPENDENCIES_INSTALL_DIR}/lib
+ #/usr/lib
+ #/usr/local/lib
+ )
+
+ find_library(JsonCpp_RELEASE_LIBRARY
+ NAMES
+ jsoncpp
+ PATHS
+ ${LibSourcey_DEPENDENCIES_BUILD_DIR}/jsoncpp
+ ${LibSourcey_DEPENDENCIES_INSTALL_DIR}/lib
+ #/usr/lib
+ #/usr/local/lib
+ )
+
+ if(JsonCpp_DEBUG_LIBRARY OR JsonCpp_RELEASE_LIBRARY)
+ if(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
+ if (JsonCpp_RELEASE_LIBRARY)
+ list(APPEND JsonCpp_LIBRARY "optimized" ${JsonCpp_RELEASE_LIBRARY})
+ endif()
+ if (JsonCpp_DEBUG_LIBRARY)
+ list(APPEND JsonCpp_LIBRARY "debug" ${JsonCpp_DEBUG_LIBRARY})
+ endif()
+ else()
+ if (JsonCpp_RELEASE_LIBRARY)
+ list(APPEND JsonCpp_LIBRARY ${JsonCpp_RELEASE_LIBRARY})
+ elseif (JsonCpp_DEBUG_LIBRARY)
+ list(APPEND JsonCpp_LIBRARY ${JsonCpp_DEBUG_LIBRARY})
+ endif()
+ endif()
+ mark_as_advanced(JsonCpp_DEBUG_LIBRARY JsonCpp_RELEASE_LIBRARY)
+ endif()
+
+else()
+
+ # TODO: jsoncpp lib names for various systems
+ #set(JsonCpp_LIB_NAMES "jsoncpp")
+
+ #if(CMAKE_COMPILER_IS_GNUCXX)
+ # # Get the GCC compiler version
+ # exec_program(${CMAKE_CXX_COMPILER}
+ # ARGS ${CMAKE_CXX_COMPILER_ARG1} -dumpversion
+ # OUTPUT_VARIABLE _gcc_COMPILER_VERSION
+ # OUTPUT_STRIP_TRAILING_WHITESPACE)
+ #
+ # set(JsonCpp_LIB_NAMES ${JsonCpp_LIB_NAMES} libjson_linux-gcc-${_gcc_COMPILER_VERSION}_libmt.so)
+ #endif()
+
+#libjsoncpp.so
+ find_library(JsonCpp_LIBRARY
+ NAMES
+ jsoncpp
+ libjsoncpp
+ PATHS
+ /usr/lib
+ /usr/local/lib
+ )
+
+endif()
+
+if(JsonCpp_LIBRARY AND JsonCpp_INCLUDE_DIR)
+ set(JsonCpp_FOUND 1)
+ mark_as_advanced(JsonCpp_LIBRARY JsonCpp_INCLUDE_DIR)
+else()
+ set(JsonCpp_FOUND 0)
+endif()
+
+#get_filename_component(JsonCpp_LIBRARY_DIR "${JsonCpp_LIBRARY}" PATH)
+#get_filename_component(JsonCpp_LIBRARY "${JsonCpp_LIBRARY}" NAME)
+
+# ----------------------------------------------------------------------
+# Display status
+# ----------------------------------------------------------------------
+if(NOT JsonCpp_FOUND)
+ if(JsonCpp_FIND_REQUIRED)
+ message(FATAL_ERROR "JsonCpp was not found. Please build dependencies first, or specify the path manually.")
+ endif()
+endif()
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..04614930b12e
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,50 @@
+pkgname=osvr-steamvr-git
+pkgver=steamvr.r33.gda5a506
+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') #TODO: add more deps
+source=("osvr-steamvr::git+https://github.com/OSVR/SteamVR-OSVR.git"
+ "Findjsoncpp.cmake")
+
+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
+ find . -name CMakeLists.txt -exec sed -i 's/jsoncpp_lib/jsoncpp/g' {} \;
+
+ mkdir -p "$srcdir/osvr-steamvr-build"
+ cp "$srcdir/Findjsoncpp.cmake" "$srcdir/osvr-steamvr/cmake"
+
+ #Why?
+ sed -i 's,"make_unique_impl.h","vendor/libcxx/include/make_unique_impl.h",g' "$srcdir/osvr-steamvr/make_unique.h"
+}
+
+build() {
+ cd osvr-steamvr-build
+ cmake -DCMAKE_INSTALL_PREFIX=/usr/ -DCMAKE_BUILD_TYPE=Release ../osvr-steamvr
+ make
+}
+
+package() {
+ cd osvr-steamvr-build
+ make DESTDIR="$pkgdir/" install
+
+ # *sigh*
+ install -d "$pkgdir/usr/lib/steamvr/drivers/osvr/bin/linux64"
+ mv "$pkgdir"/usr/drivers/linux64/driver_osvr.so "$pkgdir/usr/lib/steamvr/drivers/osvr/bin/linux64/"
+}
+md5sums=('SKIP'
+ '2dd82e55b6291d32c611dd899d8a8164')
+
+# vim:set ts=2 sw=2 et:
diff --git a/osvr-steamvr.install b/osvr-steamvr.install
new file mode 100644
index 000000000000..dbe162dd454e
--- /dev/null
+++ b/osvr-steamvr.install
@@ -0,0 +1,13 @@
+post_install() {
+ echo "==> Now copy the driver to the SteamVR directory according to https://github.com/ValveSoftware/openvr/wiki/Driver-Documentation."
+ echo "==> Should be something like:"
+ echo "==> cp -rf /usr/lib/steamvr/drivers/osvr/ ~/.local/share/Steam/SteamApps/common/OpenVR/drivers/"
+}
+
+post_upgrade() {
+ post_install
+}
+
+post_remove() {
+ post_install
+}