diff --git a/distros/ros2-overlay.nix b/distros/ros2-overlay.nix index 200bf8bdc9..77c368843e 100644 --- a/distros/ros2-overlay.nix +++ b/distros/ros2-overlay.nix @@ -72,6 +72,21 @@ rosSelf: rosSuper: with rosSelf.lib; { cmakeFlags = cmakeFlags ++ [ "-DDOWNLOAD_TOML_LIB=OFF" ]; }); + librealsense2 = rosSuper.librealsense2.overrideAttrs ({ + buildInputs, postPatch ? "", version, ... + }: { + buildInputs = buildInputs ++ + (if version >= "2.55.1" then + [ self.nlohmann_json ] + else []); + postPatch = postPatch + + (if version >= "2.55.1" then + '' + substituteInPlace third-party/CMakeLists.txt --replace-fail 'include(CMake/external_json.cmake)' "" +'' + else ""); + }); + popf = rosSuper.popf.overrideAttrs ({ nativeBuildInputs ? [], postPatch ? "", ... }: {