Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
70 lines
1.9 KiB
Nix
70 lines
1.9 KiB
Nix
{
|
|
cmake,
|
|
fetchFromGitHub,
|
|
fetchpatch2,
|
|
jsoncpp,
|
|
lib,
|
|
libGL,
|
|
stdenv,
|
|
nix-update-script,
|
|
}:
|
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
|
pname = "openvr";
|
|
version = "2.12.14";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "ValveSoftware";
|
|
repo = "openvr";
|
|
rev = "v${finalAttrs.version}";
|
|
hash = "sha256-G+xoFIabSbYEaWATGSzHP3SWkaqQhQQ6kMkYfjBXBUU=";
|
|
};
|
|
|
|
patches = [
|
|
# https://github.com/ValveSoftware/openvr/pull/594
|
|
(fetchpatch2 {
|
|
name = "use-correct-CPP11-definition-for-vsprintf_s.patch";
|
|
url = "https://github.com/ValveSoftware/openvr/commit/0fa21ba17748efcca1816536e27bdca70141b074.patch";
|
|
hash = "sha256-0sPNDx5qKqCzN35FfArbgJ0cTztQp+SMLsXICxneLx4=";
|
|
})
|
|
# https://github.com/ValveSoftware/openvr/pull/1716
|
|
(fetchpatch2 {
|
|
name = "add-ability-to-build-with-system-installed-jsoncpp.patch";
|
|
url = "https://github.com/ValveSoftware/openvr/commit/54a58e479f4d63e62e9118637cd92a2013a4fb95.patch";
|
|
hash = "sha256-aMojjbNjLvsGev0JaBx5sWuMv01sy2tG/S++I1NUi7U=";
|
|
})
|
|
];
|
|
|
|
postUnpack = ''
|
|
# Move in-tree jsoncpp out to complement the patch above
|
|
# fetchpatch2 is not able to handle these renames
|
|
mkdir source/thirdparty
|
|
mv source/src/json source/thirdparty/jsoncpp
|
|
'';
|
|
|
|
nativeBuildInputs = [
|
|
cmake
|
|
];
|
|
|
|
buildInputs = [
|
|
jsoncpp
|
|
libGL
|
|
];
|
|
|
|
cmakeFlags = [
|
|
"-DUSE_SYSTEM_JSONCPP=ON"
|
|
"-DBUILD_SHARED=1"
|
|
];
|
|
|
|
passthru.updateScript = nix-update-script { };
|
|
|
|
meta = {
|
|
broken = stdenv.hostPlatform.isDarwin;
|
|
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";
|
|
homepage = "https://github.com/ValveSoftware/openvr";
|
|
license = lib.licenses.bsd3;
|
|
maintainers = with lib.maintainers; [ Scrumplex ];
|
|
platforms = lib.platforms.unix;
|
|
};
|
|
})
|