rviz2: remove hardcoded $PREFIX/opt path

On startup Rviz2 searches for some core libraries inside a
$PREFIX/opt/rviz_ogre_vendor path hardcoded into the executable,
assuming it's being run under a regular ROS 2 installation.

As of recently nix-ros-overlay installs everything into standard
directories, including stuff that was previously put into opt/, so
Rviz2 would crash on startup.

This fixes the lookup path and makes it go search in normal directories.
This commit is contained in:
Viktor Pocedulić 2024-10-22 17:35:04 +02:00 committed by Ben Wolsieffer
parent a9a387b495
commit 42d30dff71
2 changed files with 18 additions and 0 deletions

View file

@ -204,6 +204,15 @@ in {
'';
};
rviz-rendering = rosSuper.rviz-rendering.overrideAttrs ({
postPatch ? "", ...
}: {
postPatch = postPatch + ''
substituteInPlace src/rviz_rendering/render_system.cpp \
--replace-fail /opt/rviz_ogre_vendor ""
'';
});
shared-queues-vendor = lib.patchVendorUrl rosSuper.shared-queues-vendor {
url = "https://github.com/cameron314/readerwriterqueue/archive/ef7dfbf553288064347d51b8ac335f1ca489032a.zip";
sha256 = "sha256-TyFt3d78GidhDGD17KgjAaZl/qvAcGJP8lmu4EOxpYg=";

View file

@ -204,6 +204,15 @@ in {
'';
};
rviz-rendering = rosSuper.rviz-rendering.overrideAttrs ({
postPatch ? "", ...
}: {
postPatch = postPatch + ''
substituteInPlace src/rviz_rendering/render_system.cpp \
--replace-fail /opt/rviz_ogre_vendor ""
'';
});
sdformat-vendor = lib.patchGzAmentVendorGit rosSuper.sdformat-vendor {
version = "15.0.0";
hash = "sha256-d9PKTgUIFPX1rc1HlKCQPxcUcTn2ivObMvkGz/HBExw=";