aws-lc: 1.39.0 -> 1.42.0 (#369942)
[NixPkgs.git] / pkgs / by-name / op / openvr / package.nix
blob501a74ec098fbd709a3af2279affa514146112b5
2   AppKit,
3   cmake,
4   fetchFromGitHub,
5   fetchpatch2,
6   Foundation,
7   jsoncpp,
8   lib,
9   libGL,
10   stdenv,
11   nix-update-script,
14 stdenv.mkDerivation (finalAttrs: {
15   pname = "openvr";
16   version = "2.5.1";
18   src = fetchFromGitHub {
19     owner = "ValveSoftware";
20     repo = "openvr";
21     rev = "v${finalAttrs.version}";
22     hash = "sha256-bIKjZ7DvJVmDK386WgXaAFQrS0E1TNEUMhfQp7FNnvk=";
23   };
25   patches = [
26     # https://github.com/ValveSoftware/openvr/pull/594
27     (fetchpatch2 {
28       name = "use-correct-CPP11-definition-for-vsprintf_s.patch";
29       url = "https://github.com/ValveSoftware/openvr/commit/0fa21ba17748efcca1816536e27bdca70141b074.patch";
30       hash = "sha256-0sPNDx5qKqCzN35FfArbgJ0cTztQp+SMLsXICxneLx4=";
31     })
32     # https://github.com/ValveSoftware/openvr/pull/1716
33     (fetchpatch2 {
34       name = "add-ability-to-build-with-system-installed-jsoncpp.patch";
35       url = "https://github.com/ValveSoftware/openvr/commit/54a58e479f4d63e62e9118637cd92a2013a4fb95.patch";
36       hash = "sha256-aMojjbNjLvsGev0JaBx5sWuMv01sy2tG/S++I1NUi7U=";
37     })
38   ];
40   postUnpack = ''
41     # Move in-tree jsoncpp out to complement the patch above
42     # fetchpatch2 is not able to handle these renames
43     mkdir source/thirdparty
44     mv source/src/json source/thirdparty/jsoncpp
45   '';
47   nativeBuildInputs = [
48     cmake
49   ];
51   buildInputs =
52     [
53       jsoncpp
54       libGL
55     ]
56     ++ lib.optionals stdenv.hostPlatform.isDarwin [
57       AppKit
58       Foundation
59     ];
61   cmakeFlags = [
62     "-DUSE_SYSTEM_JSONCPP=ON"
63     "-DBUILD_SHARED=1"
64   ];
66   passthru.updateScript = nix-update-script { };
68   meta = {
69     broken = stdenv.hostPlatform.isDarwin;
70     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";
71     homepage = "https://github.com/ValveSoftware/openvr";
72     license = lib.licenses.bsd3;
73     maintainers = with lib.maintainers; [ Scrumplex ];
74     platforms = lib.platforms.unix;
75   };