From 891e6fd75a10cc029141a62e92e0061975ca4585 Mon Sep 17 00:00:00 2001 From: Peder Bergebakken Sundt Date: Fri, 26 Apr 2024 15:46:27 +0200 Subject: [PATCH 1/2] librealsense: 2.54.2 -> 2.55.1 Diff: https://github.com/IntelRealSense/librealsense/compare/v2.54.2...v2.55.1 --- .../libraries/librealsense/default.nix | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/pkgs/development/libraries/librealsense/default.nix b/pkgs/development/libraries/librealsense/default.nix index 527f61b60393..4f0532de4ed6 100644 --- a/pkgs/development/libraries/librealsense/default.nix +++ b/pkgs/development/libraries/librealsense/default.nix @@ -2,9 +2,9 @@ , config , lib , fetchFromGitHub -, fetchpatch , cmake , libusb1 +, nlohmann_json , ninja , pkg-config , gcc @@ -23,7 +23,7 @@ assert enablePython -> pythonPackages != null; stdenv.mkDerivation rec { pname = "librealsense"; - version = "2.54.2"; + version = "2.55.1"; outputs = [ "out" "dev" ]; @@ -31,12 +31,13 @@ stdenv.mkDerivation rec { owner = "IntelRealSense"; repo = pname; rev = "v${version}"; - sha256 = "sha256-EbnIHnsUgsqN/SVv4m9H7K8gfwni+u82+M55QBstAGI="; + sha256 = "sha256-MNHvfWk58WRtu6Xysfvn+lx8J1+HlNw5AmmgaTAzuok="; }; buildInputs = [ libusb1 gcc.cc.lib + nlohmann_json ] ++ lib.optional cudaSupport cudaPackages.cudatoolkit ++ lib.optionals enablePython (with pythonPackages; [ python pybind11 ]) ++ lib.optionals enableGUI [ mesa gtk3 glfw libGLU curl ]; @@ -44,14 +45,16 @@ stdenv.mkDerivation rec { patches = [ ./py_pybind11_no_external_download.patch ./install-presets.patch - # https://github.com/IntelRealSense/librealsense/pull/11917 - (fetchpatch { - name = "fix-gcc13-missing-cstdint.patch"; - url = "https://github.com/IntelRealSense/librealsense/commit/b59b13671658910fc453a4a6bbd61f13ba6e83cc.patch"; - hash = "sha256-zaW8HG8rfsApI5S/3x+x9Fx8xhyTIPNn/fJVFtkmlEA="; - }) ]; + postPatch = '' + # use nixpkgs nlohmann_json instead of fetching it + substituteInPlace third-party/CMakeLists.txt \ + --replace-fail \ + 'include(CMake/external_json.cmake)' \ + 'find_package(nlohmann_json 3.11.3 REQUIRED)' + ''; + nativeBuildInputs = [ cmake ninja From 98a6160ab97959600ef689176eea572f348c54c1 Mon Sep 17 00:00:00 2001 From: Peder Bergebakken Sundt Date: Sun, 18 Aug 2024 02:04:15 +0200 Subject: [PATCH 2/2] librealsense: unbreak cuda --- pkgs/development/libraries/librealsense/default.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/development/libraries/librealsense/default.nix b/pkgs/development/libraries/librealsense/default.nix index 4f0532de4ed6..0e0bfc51cb42 100644 --- a/pkgs/development/libraries/librealsense/default.nix +++ b/pkgs/development/libraries/librealsense/default.nix @@ -38,7 +38,7 @@ stdenv.mkDerivation rec { libusb1 gcc.cc.lib nlohmann_json - ] ++ lib.optional cudaSupport cudaPackages.cudatoolkit + ] ++ lib.optionals cudaSupport [ cudaPackages.cuda_cudart ] ++ lib.optionals enablePython (with pythonPackages; [ python pybind11 ]) ++ lib.optionals enableGUI [ mesa gtk3 glfw libGLU curl ]; @@ -59,6 +59,8 @@ stdenv.mkDerivation rec { cmake ninja pkg-config + ] ++ lib.optionals cudaSupport [ + cudaPackages.cuda_nvcc ]; cmakeFlags = [