13 stdenv.mkDerivation (finalAttrs: {
17 src = fetchFromGitHub {
18 owner = "ValveSoftware";
20 rev = "v${finalAttrs.version}";
21 hash = "sha256-bIKjZ7DvJVmDK386WgXaAFQrS0E1TNEUMhfQp7FNnvk=";
25 # https://github.com/ValveSoftware/openvr/pull/594
27 name = "use-correct-CPP11-definition-for-vsprintf_s.patch";
28 url = "https://github.com/ValveSoftware/openvr/commit/0fa21ba17748efcca1816536e27bdca70141b074.patch";
29 hash = "sha256-0sPNDx5qKqCzN35FfArbgJ0cTztQp+SMLsXICxneLx4=";
31 # https://github.com/ValveSoftware/openvr/pull/1716
33 name = "add-ability-to-build-with-system-installed-jsoncpp.patch";
34 url = "https://github.com/ValveSoftware/openvr/commit/54a58e479f4d63e62e9118637cd92a2013a4fb95.patch";
35 hash = "sha256-aMojjbNjLvsGev0JaBx5sWuMv01sy2tG/S++I1NUi7U=";
40 # Move in-tree jsoncpp out to complement the patch above
41 # fetchpatch2 is not able to handle these renames
42 mkdir source/thirdparty
43 mv source/src/json source/thirdparty/jsoncpp
53 ] ++ lib.optionals stdenv.isDarwin [
58 cmakeFlags = [ "-DUSE_SYSTEM_JSONCPP=ON" "-DBUILD_SHARED=1" ];
60 passthru.updateScript = nix-update-script { };
63 broken = stdenv.isDarwin;
64 description = "API and runtime that allows access to VR hardware from multiple vendors without requiring that applications have specific knowledge of the hardware they are targeting";
65 homepage = "https://github.com/ValveSoftware/openvr";
66 license = lib.licenses.bsd3;
67 maintainers = with lib.maintainers; [ Scrumplex ];
68 platforms = lib.platforms.unix;