From 28ef9ebcad9e2af9507e3c882c39d2766eef89e5 Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Tue, 29 Aug 2023 09:57:31 +0200 Subject: [PATCH] monado: unstable-2023-01-14 -> unstable-2023-08-22 Signed-off-by: Sefa Eyeoglu --- pkgs/applications/graphics/monado/default.nix | 27 ++++++++++++++++--- .../monado/force-enable-steamvr_lh.patch | 12 +++++++++ .../monado/steamvr_lh-use-old-interface.patch | 13 +++++++++ 3 files changed, 49 insertions(+), 3 deletions(-) create mode 100644 pkgs/applications/graphics/monado/force-enable-steamvr_lh.patch create mode 100644 pkgs/applications/graphics/monado/steamvr_lh-use-old-interface.patch diff --git a/pkgs/applications/graphics/monado/default.nix b/pkgs/applications/graphics/monado/default.nix index 7a2577e8af50..c8c5e5abb37d 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 000000000000..eac92675ebd9 --- /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 000000000000..d5194956e114 --- /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(driver->GetComponent(vr::IVRDisplayComponent_Version)); ++ auto *display = static_cast(driver->GetComponent("IVRDisplayComponent_003")); + VERIFY(display, "IVRDisplayComponent is null"); + #undef VERIFY +