about summary refs log tree commit diff
path: root/pkgs/applications/graphics
diff options
context:
space:
mode:
authorWeijia Wang <9713184+wegank@users.noreply.github.com>2023-09-06 23:40:24 +0200
committerGitHub <noreply@github.com>2023-09-06 23:40:24 +0200
commit8feb7fa2a5105735ef2320b35197e5451b302645 (patch)
treea113445edfbe39375f75ec8d8839da236c8b4b6a /pkgs/applications/graphics
parent9699c0636d4beda82205295465a89bf831c8813e (diff)
parent28ef9ebcad9e2af9507e3c882c39d2766eef89e5 (diff)
Merge pull request #252103 from Scrumplex/monado-2023-08
monado: unstable-2023-01-14 -> unstable-2023-08-22
Diffstat (limited to 'pkgs/applications/graphics')
-rw-r--r--pkgs/applications/graphics/monado/default.nix27
-rw-r--r--pkgs/applications/graphics/monado/force-enable-steamvr_lh.patch12
-rw-r--r--pkgs/applications/graphics/monado/steamvr_lh-use-old-interface.patch13
3 files changed, 49 insertions, 3 deletions
diff --git a/pkgs/applications/graphics/monado/default.nix b/pkgs/applications/graphics/monado/default.nix
index 7a2577e8af50c..c8c5e5abb37de 100644
--- a/pkgs/applications/graphics/monado/default.nix
+++ b/pkgs/applications/graphics/monado/default.nix
@@ -8,6 +8,7 @@
 , pkg-config
 , python3
 , SDL2
+, bluez
 , dbus
 , eigen
 , ffmpeg
@@ -28,8 +29,10 @@
 , libuvc
 , libv4l
 , libxcb
+, onnxruntime
 , opencv4
 , openhmd
+, openvr
 , udev
 , vulkan-headers
 , vulkan-loader
@@ -47,14 +50,14 @@
 
 stdenv.mkDerivation rec {
   pname = "monado";
-  version = "unstable-2023-01-14";
+  version = "unstable-2023-08-22";
 
   src = fetchFromGitLab {
     domain = "gitlab.freedesktop.org";
     owner = "monado";
     repo = "monado";
-    rev = "1ef49b92f2d6cb519039edd7ba7f70e8073fbe88";
-    sha256 = "sha256-zieJmI6BKHpYyCPOOUora9qoWn+NXehbHKvoi4h81UA=";
+    rev = "4cc68f07c0f3c2fee57b01dde28a02e314d3bee6";
+    sha256 = "sha256-VibdOSA/b4RmwwwXrwhivuiukNK10YazYF/p+YnqRZ8=";
   };
 
   nativeBuildInputs = [
@@ -72,6 +75,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [
     SDL2
+    bluez
     dbus
     eigen
     ffmpeg
@@ -92,8 +96,10 @@ stdenv.mkDerivation rec {
     libuvc
     libv4l
     libxcb
+    onnxruntime
     opencv4
     openhmd
+    openvr
     udev
     vulkan-headers
     vulkan-loader
@@ -104,6 +110,13 @@ stdenv.mkDerivation rec {
     zlib
   ];
 
+  # known disabled drivers:
+  #  - DRIVER_DEPTHAI - Needs depthai-core https://github.com/luxonis/depthai-core
+  #  - DRIVER_ILLIXR - needs ILLIXR headers https://github.com/ILLIXR/ILLIXR
+  #  - DRIVER_REALSENSE - see below
+  #  - DRIVER_SIMULAVR - needs realsense
+  #  - DRIVER_ULV2 - needs proprietary Leapmotion SDK https://api.leapmotion.com/documentation/v2/unity/devguide/Leap_SDK_Overview.html
+
   # realsense is disabled, the build ends with the following error:
   #
   # CMake Error in src/xrt/drivers/CMakeLists.txt:
@@ -119,6 +132,14 @@ stdenv.mkDerivation rec {
     export XDG_CONFIG_DIRS=@out@/etc/xdg''${XDG_CONFIG_DIRS:+:''${XDG_CONFIG_DIRS}}
   '';
 
+  patches = [
+    # We don't have $HOME/.steam when building
+    ./force-enable-steamvr_lh.patch
+
+    # A recent (as of August 2023) SteamVR Beta has upgraded a driver interface which is incompatible with Monado
+    ./steamvr_lh-use-old-interface.patch
+  ];
+
   meta = with lib; {
     description = "Open source XR runtime";
     homepage = "https://monado.freedesktop.org/";
diff --git a/pkgs/applications/graphics/monado/force-enable-steamvr_lh.patch b/pkgs/applications/graphics/monado/force-enable-steamvr_lh.patch
new file mode 100644
index 0000000000000..eac92675ebd96
--- /dev/null
+++ b/pkgs/applications/graphics/monado/force-enable-steamvr_lh.patch
@@ -0,0 +1,12 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 4308d73d..0081d536 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -219,6 +219,7 @@ option(BUILD_TESTING "Enable building of the test suite?" ON)
+ if(EXISTS "$ENV{HOME}/.steam/root")
+ 	set(XRT_HAVE_STEAM YES)
+ endif()
++set(XRT_HAVE_STEAM YES)
+ 
+ if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
+ 	set(XRT_HAVE_INTERNAL_HID ON)
diff --git a/pkgs/applications/graphics/monado/steamvr_lh-use-old-interface.patch b/pkgs/applications/graphics/monado/steamvr_lh-use-old-interface.patch
new file mode 100644
index 0000000000000..d5194956e114b
--- /dev/null
+++ b/pkgs/applications/graphics/monado/steamvr_lh-use-old-interface.patch
@@ -0,0 +1,13 @@
+diff --git a/src/xrt/drivers/steamvr_lh/steamvr_lh.cpp b/src/xrt/drivers/steamvr_lh/steamvr_lh.cpp
+index 24b69fd..5b3a5ca 100644
+--- a/src/xrt/drivers/steamvr_lh/steamvr_lh.cpp
++++ b/src/xrt/drivers/steamvr_lh/steamvr_lh.cpp
+@@ -138,7 +138,7 @@ Context::setup_hmd(const char *serial, vr::ITrackedDeviceServerDriver *driver)
+ 	vr::EVRInitError err = driver->Activate(0);
+ 	VERIFY(err == vr::VRInitError_None, std::to_string(err).c_str());
+ 
+-	auto *display = static_cast<vr::IVRDisplayComponent *>(driver->GetComponent(vr::IVRDisplayComponent_Version));
++	auto *display = static_cast<vr::IVRDisplayComponent *>(driver->GetComponent("IVRDisplayComponent_003"));
+ 	VERIFY(display, "IVRDisplayComponent is null");
+ #undef VERIFY
+