2023-10-09 19:29:22 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitLab
|
|
|
|
|
|
|
|
, cmake
|
|
|
|
|
|
|
|
, glm
|
|
|
|
, libGL
|
|
|
|
, openxr-loader
|
|
|
|
, python3
|
|
|
|
, vulkan-headers
|
|
|
|
, vulkan-loader
|
|
|
|
, xorg
|
2024-01-13 08:15:51 +00:00
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
, unstableGitUpdater
|
2023-10-09 19:29:22 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
pname = "opencomposite";
|
2024-07-01 15:47:52 +00:00
|
|
|
version = "0-unstable-2024-06-12";
|
2023-10-09 19:29:22 +00:00
|
|
|
|
|
|
|
src = fetchFromGitLab {
|
|
|
|
owner = "znixian";
|
|
|
|
repo = "OpenOVR";
|
2024-07-01 15:47:52 +00:00
|
|
|
rev = "de1658db7e2535fd36c2e37fa8dd3d756280c86f";
|
|
|
|
hash = "sha256-xyEiuEy3nt2AbF149Pjz5wi/rkTup2SgByR4DrNOJX0=";
|
2023-10-09 19:29:22 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
glm
|
|
|
|
libGL
|
|
|
|
openxr-loader
|
|
|
|
python3
|
|
|
|
vulkan-headers
|
|
|
|
vulkan-loader
|
|
|
|
xorg.libX11
|
|
|
|
];
|
|
|
|
|
|
|
|
cmakeFlags = [
|
2024-06-05 15:53:02 +00:00
|
|
|
(lib.cmakeBool "USE_SYSTEM_OPENXR" true)
|
|
|
|
(lib.cmakeBool "USE_SYSTEM_GLM" true)
|
2023-10-09 19:29:22 +00:00
|
|
|
];
|
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
# NOTE: `cmakeFlags` will get later tokenized by bash and there is no way
|
|
|
|
# of inserting a flag value with a space in it (inserting `"` or `'` won't help).
|
|
|
|
# https://discourse.nixos.org/t/cmakeflags-and-spaces-in-option-values/20170/2
|
|
|
|
preConfigure = ''
|
|
|
|
cmakeFlagsArray+=(
|
|
|
|
"-DCMAKE_CXX_FLAGS=-DGLM_ENABLE_EXPERIMENTAL -Wno-error=format-security"
|
|
|
|
)
|
|
|
|
'';
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
mkdir -p $out/lib/opencomposite
|
|
|
|
cp -r bin/ $out/lib/opencomposite
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
passthru.updateScript = unstableGitUpdater {
|
|
|
|
hardcodeZeroVersion = true;
|
|
|
|
branch = "openxr";
|
2024-01-13 08:15:51 +00:00
|
|
|
};
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Reimplementation of OpenVR, translating calls to OpenXR";
|
|
|
|
homepage = "https://gitlab.com/znixian/OpenOVR";
|
|
|
|
license = with licenses; [ gpl3Only ];
|
|
|
|
maintainers = with maintainers; [ Scrumplex ];
|
|
|
|
};
|
|
|
|
}
|