Skip to content

Commit

Permalink
moveit2: apply fix globally for all distros
Browse files Browse the repository at this point in the history
  • Loading branch information
okvik authored and lopsided98 committed Nov 15, 2024
1 parent dccccc3 commit 5034180
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 54 deletions.
64 changes: 64 additions & 0 deletions distros/distro-overlay.nix
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,16 @@ let
setupHook = ./gazebo-ros-setup-hook.sh;
});

geometric-shapes = rosSuper.geometric-shapes.overrideAttrs({
postPatch ? "", ...
}: {
postPatch = postPatch + ''
substituteInPlace CMakeLists.txt --replace-fail \
'find_package(octomap 1.9.7...<1.10.0 REQUIRED)' \
'find_package(octomap REQUIRED)'
'';
});

gmapping = patchBoostSignals rosSuper.gmapping;

image-cb-detector = patchBoostSignals rosSuper.image-cb-detector;
Expand Down Expand Up @@ -166,6 +176,60 @@ let
'';
});

moveit-core = rosSuper.moveit-core.overrideAttrs({
postPatch ? "", ...
}: {
postPatch = postPatch + ''
substituteInPlace CMakeLists.txt --replace-fail \
'find_package(octomap 1.9.7...<1.10.0 REQUIRED)' \
'find_package(octomap REQUIRED)'
'';
});

moveit-ros-occupancy-map-monitor = rosSuper.moveit-ros-occupancy-map-monitor.overrideAttrs({
postPatch ? "", ...
}: {
postPatch = postPatch + ''
substituteInPlace CMakeLists.txt --replace-fail \
'find_package(octomap 1.9.7...<1.10.0 REQUIRED)' \
'find_package(octomap REQUIRED)'
'';
});

osqp-vendor = pipe rosSuper.osqp-vendor [
# Make CMakeLists.txt amenable to automatic patching by the next step.
(pkg: pkg.overrideAttrs ({ prePatch ? "", ... }: {
prePatch = prePatch + ''
substituteInPlace CMakeLists.txt --replace-fail \
'set(git_tag "v0.6.2")' \
'set(git_tag "v0.6.2")' # fail when upstream version changes
substituteInPlace CMakeLists.txt --replace-fail \
'GIT_TAG ''${git_tag}' \
'GIT_TAG v0.6.2'
'';
}))

(pkg: patchExternalProjectGit pkg {
url = "https://github.com/osqp/osqp.git";
rev = "v0.6.2";
fetchgitArgs = {
hash = "sha256-0BbUe1J9qzvyKDBLTz+pAEmR3QpRL+hnxZ2re/3mEvs=";
leaveDotGit = true;
};
})

# osqp installs into both lib/cmake/ and lib64/cmake/ which is problematic
# because moveLib64 doesn't attempt to merge overlapping directories but
# fails instead. Here we do the merge manually.
(pkg: pkg.overrideAttrs ({ preInstall ? "", ... }: {
preInstall = preInstall + ''
mkdir -p ./osqp_install/lib/cmake/osqp
mv ./osqp_install/lib64/cmake/osqp/* ./osqp_install/lib/cmake/osqp
rm -r ./osqp_install/lib64/cmake
'';
}))
];

ompl = rosSuper.ompl.overrideAttrs ({
patches ? [], ...
}: {
Expand Down
54 changes: 0 additions & 54 deletions distros/jazzy/overrides.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,6 @@ in {

gazebo = self.gazebo_11;

geometric-shapes = rosSuper.geometric-shapes.overrideAttrs({
postPatch ? "", ...
}: {
postPatch = postPatch + ''
substituteInPlace CMakeLists.txt --replace-fail 'find_package(octomap 1.9.7...<1.10.0 REQUIRED)' 'find_package(octomap REQUIRED)'
'';
});

google-benchmark-vendor = lib.patchExternalProjectGit rosSuper.google-benchmark-vendor {
url = "https://github.com/google/benchmark.git";
rev = "344117638c8ff7e239044fd0fa7085839fc03021";
Expand Down Expand Up @@ -192,52 +184,6 @@ in {
hash = "sha256-Qaz26F11VWxkQH8HfgVJLTHbHwmeByQu8ENkuyk5rPE=";
};

moveit-core = rosSuper.moveit-core.overrideAttrs({
postPatch ? "", ...
}: {
postPatch = postPatch + ''
substituteInPlace CMakeLists.txt --replace-fail 'find_package(octomap 1.9.7...<1.10.0 REQUIRED)' 'find_package(octomap REQUIRED)'
'';
});

moveit-ros-occupancy-map-monitor = rosSuper.moveit-ros-occupancy-map-monitor.overrideAttrs({
postPatch ? "", ...
}: {
postPatch = postPatch + ''
substituteInPlace CMakeLists.txt --replace-fail 'find_package(octomap 1.9.7...<1.10.0 REQUIRED)' 'find_package(octomap REQUIRED)'
'';
});

osqp-vendor = lib.pipe rosSuper.osqp-vendor [
# Make CMakeLists.txt amenable to automatic patching by the next step.
(pkg: pkg.overrideAttrs ({ prePatch ? "", ... }: {
prePatch = prePatch + ''
substituteInPlace CMakeLists.txt --replace-fail 'set(git_tag "v0.6.2")' 'set(git_tag "v0.6.2")' # fail when upstream version changes
substituteInPlace CMakeLists.txt --replace-fail 'GIT_TAG ''${git_tag}' 'GIT_TAG v0.6.2'
'';
}))

(pkg: lib.patchExternalProjectGit pkg {
url = "https://github.com/osqp/osqp.git";
rev = "v0.6.2";
fetchgitArgs = {
hash = "sha256-0BbUe1J9qzvyKDBLTz+pAEmR3QpRL+hnxZ2re/3mEvs=";
leaveDotGit = true;
};
})

# osqp installs into both lib/cmake/ and lib64/cmake/ which is problematic
# because moveLib64 doesn't attempt to merge overlapping directories but
# fails instead. Here we do the merge manually.
(pkg: pkg.overrideAttrs ({ preInstall ? "", ... }: {
preInstall = preInstall + ''
mkdir -p ./osqp_install/lib/cmake/osqp
mv ./osqp_install/lib64/cmake/osqp/* ./osqp_install/lib/cmake/osqp
rm -r ./osqp_install/lib64/cmake
'';
}))
];

rviz-ogre-vendor = lib.patchAmentVendorGit rosSuper.rviz-ogre-vendor {
url = "https://github.com/OGRECave/ogre.git";
rev = "v1.12.10";
Expand Down

0 comments on commit 5034180

Please sign in to comment.