nixpkgs/pkgs/by-name/wi/wivrn/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

243 lines
4.9 KiB
Nix
Raw Normal View History

2024-06-03 17:10:24 +00:00
{
2024-10-20 17:12:57 +00:00
# Commented packages are not currently in nixpkgs. They don't appear to cause a problem when not present.
2024-06-03 17:10:24 +00:00
config,
lib,
stdenv,
fetchFromGitHub,
fetchFromGitLab,
applyPatches,
autoAddDriverRunpath,
avahi,
2024-10-20 17:12:57 +00:00
bluez,
2024-06-03 17:10:24 +00:00
boost,
2024-10-20 17:12:57 +00:00
cjson,
2024-06-03 17:10:24 +00:00
cli11,
cmake,
cudaPackages ? { },
cudaSupport ? config.cudaSupport,
2024-10-20 17:12:57 +00:00
dbus,
# depthai
doxygen,
2024-06-03 17:10:24 +00:00
eigen,
2024-10-20 17:12:57 +00:00
elfutils,
2024-06-03 17:10:24 +00:00
ffmpeg,
freetype,
git,
2024-10-20 17:12:57 +00:00
glib,
2024-06-03 17:10:24 +00:00
glm,
glslang,
2024-10-20 17:12:57 +00:00
gst_all_1,
2024-06-03 17:10:24 +00:00
harfbuzz,
2024-10-20 17:12:57 +00:00
hidapi,
# leapsdk
# leapv2
2024-06-03 17:10:24 +00:00
libGL,
libX11,
libXrandr,
2024-10-20 17:12:57 +00:00
libbsd,
libdrm,
libdwg,
libjpeg,
libmd,
libnotify,
libpulseaudio,
librealsense,
librsvg,
libsurvive,
libunwind,
libusb1,
libuvc,
libva,
makeDesktopItem,
2024-06-03 17:10:24 +00:00
nix-update-script,
nlohmann_json,
onnxruntime,
2024-10-20 17:12:57 +00:00
opencv4,
openhmd,
openvr,
2024-06-03 17:10:24 +00:00
openxr-loader,
2024-10-20 17:12:57 +00:00
orc,
# percetto
2024-06-03 17:10:24 +00:00
pipewire,
pkg-config,
python3,
2024-10-20 17:12:57 +00:00
qt6,
SDL2,
2024-06-03 17:10:24 +00:00
shaderc,
spdlog,
systemd,
udev,
vulkan-headers,
vulkan-loader,
2024-10-20 17:12:57 +00:00
wayland,
wayland-protocols,
wayland-scanner,
2024-06-03 17:10:24 +00:00
x264,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "wivrn";
2024-10-20 17:12:57 +00:00
version = "0.22";
2024-06-03 17:10:24 +00:00
src = fetchFromGitHub {
owner = "wivrn";
repo = "wivrn";
rev = "v${finalAttrs.version}";
2024-10-20 17:12:57 +00:00
hash = "sha256-i/CG+zD64cwnu0z1BRkRn7Wm67KszE+wZ5geeAvrvMY=";
2024-06-03 17:10:24 +00:00
};
monado = applyPatches {
src = fetchFromGitLab {
domain = "gitlab.freedesktop.org";
owner = "monado";
repo = "monado";
2024-10-20 17:12:57 +00:00
rev = "aa2b0f9f1d638becd6bb9ca3c357ac2561a36b07";
hash = "sha256-yfHtkMvX/gyVG0UgpSB6KjSDdCym6Reb9LRb3OortaI=";
2024-06-03 17:10:24 +00:00
};
patches = [
2024-10-20 17:12:57 +00:00
./force-enable-steamvr_lh.patch
2024-06-03 17:10:24 +00:00
];
2024-10-20 17:12:57 +00:00
postPatch = ''
${finalAttrs.src}/patches/apply.sh ${finalAttrs.src}/patches/monado/*
'';
2024-06-03 17:10:24 +00:00
};
strictDeps = true;
postUnpack = ''
# Let's make sure our monado source revision matches what is used by WiVRn upstream
ourMonadoRev="${finalAttrs.monado.src.rev}"
theirMonadoRev=$(grep "GIT_TAG" ${finalAttrs.src.name}/CMakeLists.txt | awk '{print $2}')
if [ ! "$theirMonadoRev" == "$ourMonadoRev" ]; then
echo "Our Monado source revision doesn't match CMakeLists.txt." >&2
echo " theirs: $theirMonadoRev" >&2
echo " ours: $ourMonadoRev" >&2
return 1
fi
'';
2024-10-20 17:12:57 +00:00
nativeBuildInputs =
[
cmake
doxygen
git
glib
glslang
librsvg
pkg-config
python3
qt6.wrapQtAppsHook
]
++ lib.optionals cudaSupport [
autoAddDriverRunpath
];
2024-06-03 17:10:24 +00:00
2024-10-20 17:12:57 +00:00
buildInputs =
[
avahi
boost
bluez
cjson
cli11
dbus
eigen
elfutils
ffmpeg
freetype
glib
glm
gst_all_1.gst-plugins-base
gst_all_1.gstreamer
harfbuzz
hidapi
libbsd
libdrm
libdwg
libGL
libjpeg
libmd
libnotify
librealsense
libsurvive
libunwind
libusb1
libuvc
libva
libX11
libXrandr
libpulseaudio
nlohmann_json
opencv4
openhmd
openvr
openxr-loader
onnxruntime
orc
pipewire
qt6.qtbase
qt6.qttools
SDL2
shaderc
spdlog
systemd
udev
vulkan-headers
vulkan-loader
wayland
wayland-protocols
wayland-scanner
x264
]
++ lib.optionals cudaSupport [
cudaPackages.cudatoolkit
];
2024-06-03 17:10:24 +00:00
cmakeFlags = [
2024-10-20 17:12:57 +00:00
(lib.cmakeBool "WIVRN_USE_NVENC" cudaSupport)
2024-06-03 17:10:24 +00:00
(lib.cmakeBool "WIVRN_USE_VAAPI" true)
2024-10-20 17:12:57 +00:00
(lib.cmakeBool "WIVRN_USE_VULKAN" true)
2024-06-03 17:10:24 +00:00
(lib.cmakeBool "WIVRN_USE_X264" true)
(lib.cmakeBool "WIVRN_USE_PIPEWIRE" true)
(lib.cmakeBool "WIVRN_USE_PULSEAUDIO" true)
2024-10-20 17:12:57 +00:00
(lib.cmakeBool "WIVRN_FEATURE_STEAMVR_LIGHTHOUSE" true)
2024-06-03 17:10:24 +00:00
(lib.cmakeBool "WIVRN_BUILD_CLIENT" false)
2024-10-20 17:12:57 +00:00
(lib.cmakeBool "WIVRN_BUILD_DASHBOARD" true)
(lib.cmakeBool "WIVRN_CHECK_CAPSYSNICE" false)
2024-06-03 17:10:24 +00:00
(lib.cmakeBool "FETCHCONTENT_FULLY_DISCONNECTED" true)
2024-10-20 17:12:57 +00:00
(lib.cmakeFeature "WIVRN_OPENXR_MANIFEST_TYPE" "absolute")
(lib.cmakeFeature "GIT_DESC" "${finalAttrs.version}")
2024-06-03 17:10:24 +00:00
(lib.cmakeFeature "FETCHCONTENT_SOURCE_DIR_MONADO" "${finalAttrs.monado}")
2024-10-20 17:12:57 +00:00
(lib.cmakeFeature "CUDA_TOOLKIT_ROOT_DIR" "${cudaPackages.cudatoolkit}")
];
desktopItems = [
(makeDesktopItem {
name = "WiVRn Server";
desktopName = "WiVRn Server";
genericName = "WiVRn Server";
comment = "Play your PC VR games on a standalone headset";
icon = "io.github.wivrn.wivrn";
exec = "wivrn-dashboard";
type = "Application";
categories = [
"Network"
"Game"
];
})
2024-06-03 17:10:24 +00:00
];
passthru.updateScript = nix-update-script { };
meta = with lib; {
description = "An OpenXR streaming application to a standalone headset";
2024-10-20 17:12:57 +00:00
homepage = "https://github.com/WiVRn/WiVRn/";
changelog = "https://github.com/WiVRn/WiVRn/releases/";
2024-06-03 17:10:24 +00:00
license = licenses.gpl3Only;
maintainers = with maintainers; [ passivelemon ];
platforms = platforms.linux;
mainProgram = "wivrn-server";
2024-10-20 17:12:57 +00:00
sourceProvenance = with sourceTypes; [ fromSource ];
2024-06-03 17:10:24 +00:00
};
})