slackdump: 3.0.3 -> 3.0.5 (#379390)
[NixPkgs.git] / pkgs / by-name / mo / monado / package.nix
blob9930e8fca56661484126c3e0bc13d567de273409
2   lib,
3   stdenv,
4   fetchFromGitLab,
5   writeText,
6   bluez,
7   cjson,
8   cmake,
9   config,
10   dbus,
11   doxygen,
12   eigen,
13   elfutils,
14   fetchpatch2,
15   glslang,
16   gst-plugins-base,
17   gstreamer,
18   hidapi,
19   libbsd,
20   libdrm,
21   libffi,
22   libGL,
23   libjpeg,
24   librealsense,
25   libsurvive,
26   libunwind,
27   libusb1,
28   libuv,
29   libuvc,
30   libv4l,
31   libXau,
32   libxcb,
33   libXdmcp,
34   libXext,
35   libXrandr,
36   nix-update-script,
37   onnxruntime,
38   opencv4,
39   openhmd,
40   openvr,
41   orc,
42   pcre2,
43   pkg-config,
44   python3,
45   SDL2,
46   shaderc,
47   tracy,
48   udev,
49   vulkan-headers,
50   vulkan-loader,
51   wayland,
52   wayland-protocols,
53   wayland-scanner,
54   zlib,
55   zstd,
56   nixosTests,
57   cudaPackages,
58   enableCuda ? config.cudaSupport,
59   # Set as 'false' to build monado without service support, i.e. allow VR
60   # applications linking against libopenxr_monado.so to use OpenXR standalone
61   # instead of via the monado-service program. For more information see:
62   # https://gitlab.freedesktop.org/monado/monado/-/blob/master/doc/targets.md#xrt_feature_service-disabled
63   serviceSupport ? true,
64   tracingSupport ? false,
67 stdenv.mkDerivation (finalAttrs: {
68   pname = "monado";
69   version = "24.0.0";
71   src = fetchFromGitLab {
72     domain = "gitlab.freedesktop.org";
73     owner = "monado";
74     repo = "monado";
75     rev = "refs/tags/v${finalAttrs.version}";
76     hash = "sha256-lFy0VvaLD4Oyu2TZJnaIWjuaJUZjGGDJS0VsRfIUpcc=";
77   };
79   nativeBuildInputs = [
80     cmake
81     doxygen
82     glslang
83     pkg-config
84     python3
85   ];
87   # known disabled drivers/features:
88   #  - DRIVER_DEPTHAI - Needs depthai-core https://github.com/luxonis/depthai-core (See https://github.com/NixOS/nixpkgs/issues/292618)
89   #  - DRIVER_ILLIXR - needs ILLIXR headers https://github.com/ILLIXR/ILLIXR (See https://github.com/NixOS/nixpkgs/issues/292661)
90   #  - DRIVER_ULV2 - Needs proprietary Leapmotion SDK https://api.leapmotion.com/documentation/v2/unity/devguide/Leap_SDK_Overview.html (See https://github.com/NixOS/nixpkgs/issues/292624)
91   #  - DRIVER_ULV5 - Needs proprietary Leapmotion SDK https://api.leapmotion.com/documentation/v2/unity/devguide/Leap_SDK_Overview.html (See https://github.com/NixOS/nixpkgs/issues/292624)
93   buildInputs =
94     [
95       bluez
96       cjson
97       dbus
98       eigen
99       elfutils
100       gst-plugins-base
101       gstreamer
102       hidapi
103       libbsd
104       libdrm
105       libffi
106       libGL
107       libjpeg
108       librealsense
109       libsurvive
110       libunwind
111       libusb1
112       libuv
113       libuvc
114       libv4l
115       libXau
116       libxcb
117       libXdmcp
118       libXext
119       libXrandr
120       onnxruntime
121       opencv4
122       openhmd
123       openvr
124       orc
125       pcre2
126       SDL2
127       shaderc
128       udev
129       vulkan-headers
130       vulkan-loader
131       wayland
132       wayland-protocols
133       wayland-scanner
134       zlib
135       zstd
136     ]
137     ++ lib.optionals tracingSupport [
138       tracy
139     ];
141   patches = [
142     # Remove this patch on the next update
143     # https://gitlab.freedesktop.org/monado/monado/-/merge_requests/2338
144     (fetchpatch2 {
145       name = "improve-reproducibility.patch";
146       url = "https://gitlab.freedesktop.org/monado/monado/-/commit/9819fb6dd61d2af5b2d993ed37b976760002b055.patch";
147       hash = "sha256-qpTF1Q64jl8ZnJzMtflrpHLahCqfde2DXA9/Avlc18I=";
148     })
149   ];
151   cmakeFlags = [
152     (lib.cmakeBool "XRT_FEATURE_SERVICE" serviceSupport)
153     (lib.cmakeBool "XRT_HAVE_TRACY" tracingSupport)
154     (lib.cmakeBool "XRT_FEATURE_TRACING" tracingSupport)
155     (lib.cmakeBool "XRT_OPENXR_INSTALL_ABSOLUTE_RUNTIME_PATH" true)
156     (lib.cmakeBool "XRT_HAVE_STEAM" true)
157     (lib.optionals enableCuda "-DCUDA_TOOLKIT_ROOT_DIR=${cudaPackages.cudatoolkit}")
158   ];
160   # Help openxr-loader find this runtime
161   setupHook = writeText "setup-hook" ''
162     export XDG_CONFIG_DIRS=@out@/etc/xdg''${XDG_CONFIG_DIRS:+:''${XDG_CONFIG_DIRS}}
163   '';
165   passthru = {
166     updateScript = nix-update-script { };
167     tests.basic-service = nixosTests.monado;
168   };
170   meta = {
171     description = "Open source XR runtime";
172     homepage = "https://monado.freedesktop.org/";
173     license = lib.licenses.boost;
174     maintainers = with lib.maintainers; [
175       Scrumplex
176       prusnak
177     ];
178     platforms = lib.platforms.linux;
179     mainProgram = "monado-cli";
180   };