Skip to content

Commit

Permalink
librealsense2: cleanup patching
Browse files Browse the repository at this point in the history
There is no need for the version conditional, as every distro uses the
same version (or newer in the future).
  • Loading branch information
lopsided98 committed Jul 26, 2024
1 parent 1f4b95f commit 71487c8
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions distros/ros2-overlay.nix
Original file line number Diff line number Diff line change
Expand Up @@ -72,19 +72,15 @@ rosSelf: rosSuper: with rosSelf.lib; {
cmakeFlags = cmakeFlags ++ [ "-DDOWNLOAD_TOML_LIB=OFF" ];
});

# Get rid of nlohmann_json vendoring
librealsense2 = rosSuper.librealsense2.overrideAttrs ({
buildInputs, postPatch ? "", version, ...
buildInputs ? [], postPatch ? "", ...
}: {
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 "");
buildInputs = buildInputs ++ [ self.nlohmann_json ];
postPatch = postPatch + ''
substituteInPlace third-party/CMakeLists.txt \
--replace-fail 'include(CMake/external_json.cmake)' ""
'';
});

popf = rosSuper.popf.overrideAttrs ({
Expand Down

0 comments on commit 71487c8

Please sign in to comment.