monado: backport reproducibility fix (#350271)

This commit is contained in:
Sefa Eyeoglu 2024-11-24 13:23:05 +01:00 committed by GitHub
commit 622dc438f9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,64 +1,66 @@
{ lib {
, stdenv lib,
, fetchFromGitLab stdenv,
, writeText fetchFromGitLab,
, bluez writeText,
, cjson bluez,
, cmake cjson,
, config cmake,
, dbus config,
, doxygen dbus,
, eigen doxygen,
, elfutils eigen,
, glslang elfutils,
, gst-plugins-base fetchpatch2,
, gstreamer glslang,
, hidapi gst-plugins-base,
, libbsd gstreamer,
, libdrm hidapi,
, libffi libbsd,
, libGL libdrm,
, libjpeg libffi,
, librealsense libGL,
, libsurvive libjpeg,
, libunwind librealsense,
, libusb1 libsurvive,
, libuv libunwind,
, libuvc libusb1,
, libv4l libuv,
, libXau libuvc,
, libxcb libv4l,
, libXdmcp libXau,
, libXext libxcb,
, libXrandr libXdmcp,
, nix-update-script libXext,
, onnxruntime libXrandr,
, opencv4 nix-update-script,
, openhmd onnxruntime,
, openvr opencv4,
, orc openhmd,
, pcre2 openvr,
, pkg-config orc,
, python3 pcre2,
, SDL2 pkg-config,
, shaderc python3,
, tracy SDL2,
, udev shaderc,
, vulkan-headers tracy,
, vulkan-loader udev,
, wayland vulkan-headers,
, wayland-protocols vulkan-loader,
, wayland-scanner wayland,
, zlib wayland-protocols,
, zstd wayland-scanner,
, nixosTests zlib,
, cudaPackages zstd,
, enableCuda ? config.cudaSupport nixosTests,
cudaPackages,
enableCuda ? config.cudaSupport,
# Set as 'false' to build monado without service support, i.e. allow VR # Set as 'false' to build monado without service support, i.e. allow VR
# applications linking against libopenxr_monado.so to use OpenXR standalone # applications linking against libopenxr_monado.so to use OpenXR standalone
# instead of via the monado-service program. For more information see: # instead of via the monado-service program. For more information see:
# https://gitlab.freedesktop.org/monado/monado/-/blob/master/doc/targets.md#xrt_feature_service-disabled # https://gitlab.freedesktop.org/monado/monado/-/blob/master/doc/targets.md#xrt_feature_service-disabled
, serviceSupport ? true serviceSupport ? true,
}: }:
stdenv.mkDerivation (finalAttrs: { stdenv.mkDerivation (finalAttrs: {
@ -81,14 +83,11 @@ stdenv.mkDerivation (finalAttrs: {
python3 python3
]; ];
cmakeFlags = [ # known disabled drivers/features:
(lib.cmakeBool "XRT_FEATURE_SERVICE" serviceSupport) # - DRIVER_DEPTHAI - Needs depthai-core https://github.com/luxonis/depthai-core (See https://github.com/NixOS/nixpkgs/issues/292618)
(lib.cmakeBool "XRT_OPENXR_INSTALL_ABSOLUTE_RUNTIME_PATH" true) # - DRIVER_ILLIXR - needs ILLIXR headers https://github.com/ILLIXR/ILLIXR (See https://github.com/NixOS/nixpkgs/issues/292661)
(lib.cmakeBool "XRT_HAVE_TRACY" true) # - DRIVER_ULV2 - Needs proprietary Leapmotion SDK https://api.leapmotion.com/documentation/v2/unity/devguide/Leap_SDK_Overview.html (See https://github.com/NixOS/nixpkgs/issues/292624)
(lib.cmakeBool "XRT_FEATURE_TRACING" true) # - DRIVER_ULV5 - Needs proprietary Leapmotion SDK https://api.leapmotion.com/documentation/v2/unity/devguide/Leap_SDK_Overview.html (See https://github.com/NixOS/nixpkgs/issues/292624)
(lib.cmakeBool "XRT_HAVE_STEAM" true)
(lib.optionals enableCuda "-DCUDA_TOOLKIT_ROOT_DIR=${cudaPackages.cudatoolkit}")
];
buildInputs = [ buildInputs = [
bluez bluez
@ -135,11 +134,24 @@ stdenv.mkDerivation (finalAttrs: {
zstd zstd
]; ];
# known disabled drivers/features: patches = [
# - DRIVER_DEPTHAI - Needs depthai-core https://github.com/luxonis/depthai-core (See https://github.com/NixOS/nixpkgs/issues/292618) # Remove this patch on the next update
# - DRIVER_ILLIXR - needs ILLIXR headers https://github.com/ILLIXR/ILLIXR (See https://github.com/NixOS/nixpkgs/issues/292661) # https://gitlab.freedesktop.org/monado/monado/-/merge_requests/2338
# - DRIVER_ULV2 - Needs proprietary Leapmotion SDK https://api.leapmotion.com/documentation/v2/unity/devguide/Leap_SDK_Overview.html (See https://github.com/NixOS/nixpkgs/issues/292624) (fetchpatch2 {
# - DRIVER_ULV5 - Needs proprietary Leapmotion SDK https://api.leapmotion.com/documentation/v2/unity/devguide/Leap_SDK_Overview.html (See https://github.com/NixOS/nixpkgs/issues/292624) name = "improve-reproducibility.patch";
url = "https://gitlab.freedesktop.org/monado/monado/-/commit/9819fb6dd61d2af5b2d993ed37b976760002b055.patch";
hash = "sha256-qpTF1Q64jl8ZnJzMtflrpHLahCqfde2DXA9/Avlc18I=";
})
];
cmakeFlags = [
(lib.cmakeBool "XRT_FEATURE_SERVICE" serviceSupport)
(lib.cmakeBool "XRT_OPENXR_INSTALL_ABSOLUTE_RUNTIME_PATH" true)
(lib.cmakeBool "XRT_HAVE_TRACY" true)
(lib.cmakeBool "XRT_FEATURE_TRACING" true)
(lib.cmakeBool "XRT_HAVE_STEAM" true)
(lib.optionals enableCuda "-DCUDA_TOOLKIT_ROOT_DIR=${cudaPackages.cudatoolkit}")
];
# Help openxr-loader find this runtime # Help openxr-loader find this runtime
setupHook = writeText "setup-hook" '' setupHook = writeText "setup-hook" ''
@ -151,12 +163,15 @@ stdenv.mkDerivation (finalAttrs: {
tests.basic-service = nixosTests.monado; tests.basic-service = nixosTests.monado;
}; };
meta = with lib; { meta = {
description = "Open source XR runtime"; description = "Open source XR runtime";
homepage = "https://monado.freedesktop.org/"; homepage = "https://monado.freedesktop.org/";
license = licenses.boost; license = lib.licenses.boost;
maintainers = with maintainers; [ Scrumplex prusnak ]; maintainers = with lib.maintainers; [
platforms = platforms.linux; Scrumplex
prusnak
];
platforms = lib.platforms.linux;
mainProgram = "monado-cli"; mainProgram = "monado-cli";
}; };
}) })