nix-ros-overlay/distros/distro-overlay.nix

485 lines
16 KiB
Nix
Raw Normal View History

{ distro, python }:
2019-04-16 15:02:56 -04:00
self: super:
let
pythonOverridesFor = with self.lib; superPython: fix (python: superPython.override ({
packageOverrides ? _: _: {}, ...
}: {
self = python;
packageOverrides = composeExtensions packageOverrides
(pySelf: pySuper: optionalAttrs pySuper.isPy3k {
wxPython = pySelf.wxPython_4_0;
});
}));
base = rosSelf: rosSuper: {
lib = super.lib // import ../lib { inherit self rosSelf; };
callPackage = self.newScope rosSelf;
buildRosPackage = rosSelf.callPackage ./build-ros-package { };
buildEnv = rosSelf.callPackage ./build-env {
inherit (self) buildEnv;
};
python = pythonOverridesFor python;
pythonPackages = rosSelf.python.pkgs;
python3 = pythonOverridesFor self.python3;
python3Packages = rosSelf.python3.pkgs;
2022-01-09 12:06:17 -05:00
boost = self.boost.override {
python = rosSelf.python;
enablePython = true;
};
};
2019-12-06 17:18:47 -05:00
overrides = rosSelf: rosSuper: with rosSelf.lib; {
# ROS package overrides/fixups
2022-01-08 16:31:28 -05:00
# Fix usages of global Boost placeholders
# https://github.com/ros/actionlib/pull/197
actionlib = rosSuper.actionlib.overrideAttrs ({
patches ? [], ...
}: {
patches = patches ++ [ (self.fetchpatch {
url = "https://github.com/lopsided98/actionlib/commit/d675dd75d9080d2832591e0220d19e0f0d981446.patch";
stripLen = 1;
includes = [ "include/*" ];
sha256 = "sha256-bB8PkiDisgBgZoDyieiT1dSQK/xSfG8ZZOJyigX0SYY=";
}) ];
});
ament-cmake-core = rosSuper.ament-cmake-core.overrideAttrs ({ ... }: {
setupHook = ./ament-cmake-core-setup-hook.sh;
});
2019-04-08 17:28:23 -04:00
catkin = rosSuper.catkin.overrideAttrs ({
2019-05-12 19:37:25 -04:00
propagatedBuildInputs ? [],
2019-04-08 12:36:05 -04:00
prePhases ? [],
postPatch ? "", ...
}: let
setupHook = rosSelf.callPackage ./catkin-setup-hook { };
in {
propagatedBuildInputs = [ self.cmake setupHook ] ++ propagatedBuildInputs;
postPatch = postPatch + ''
patchShebangs cmake
substituteInPlace cmake/templates/python_distutils_install.sh.in \
--replace /usr/bin/env "${self.coreutils}/bin/env"
'';
});
2019-04-08 12:36:05 -04:00
# Packages that depend on catkin-pip still fail because they try to
# download from the internet, but it should work outside of Nix builds.
2019-04-08 17:28:23 -04:00
catkin-pip = rosSuper.catkin-pip.overrideAttrs ({
2019-04-08 12:36:05 -04:00
postPatch ? "", ...
}: {
postPatch = postPatch + ''
patchShebangs cmake
substituteInPlace cmake/scripts/path_prepend.sh \
--replace /bin/sed "${self.gnused}/bin/sed"
substituteInPlace cmake/catkin-pip-prefix.cmake.in \
--replace NO_SYSTEM_ENVIRONMENT_PATH ""
'';
});
2019-12-10 14:40:56 -05:00
cob-light = patchBoostSignals rosSuper.cob-light;
2020-06-24 18:48:21 -04:00
cyclonedds = rosSuper.cyclonedds.overrideAttrs ({
2020-11-14 14:45:43 -05:00
cmakeFlags ? [], preConfigure ? "", ...
2020-06-24 18:48:21 -04:00
}: {
# Tries to download something with maven
cmakeFlags = cmakeFlags ++ [ "-DBUILD_IDLC=OFF" ];
2020-11-14 14:45:43 -05:00
# Fix running ddsconf from within the build directory (probably an RPATH
# issue)
preConfigure = preConfigure + ''
export LD_LIBRARY_PATH="$(pwd)/build/lib"
'';
2020-06-24 18:48:21 -04:00
});
2019-04-08 17:28:23 -04:00
dynamic-reconfigure = rosSuper.dynamic-reconfigure.overrideAttrs ({
postPatch ? "", ...
}: {
postPatch = postPatch + ''
substituteInPlace cmake/setup_custom_pythonpath.sh.in \
--replace '#!/usr/bin/env sh' '#!${self.stdenv.shell}'
'';
});
fake-localization = patchBoostSignals rosSuper.fake-localization;
2021-05-30 12:00:27 -04:00
fcl-catkin = patchVendorUrl rosSuper.fcl-catkin {
url = "https://github.com/flexible-collision-library/fcl/archive/v0.6.1.zip";
sha256 = "0nryr4hg3lha1aaz35wbqr42lb6l8alfcy6slj2yn2dgb5syrmn2";
};
2020-02-04 21:08:38 -05:00
fmilibrary-vendor = patchVendorGit rosSuper.fmilibrary-vendor {
url = "https://github.com/modelon-community/fmi-library.git";
fetchgitArgs = {
rev = "2.1";
sha256 = "177rlw1ba1y0ahi8qfpg0sflh8mjdl6fmffwjg2a5vxyxwdwrjvh";
};
2019-09-06 00:44:00 -04:00
};
2020-08-07 15:17:53 -04:00
# This is a newer version than the build system tries to download, but this
# version doesn't try to download tons of random files during build.
foonathan-memory-vendor = patchVendorGit rosSuper.foonathan-memory-vendor {
url = "https://github.com/foonathan/memory.git";
fetchgitArgs = {
2020-08-07 15:17:53 -04:00
rev = "293f88d3a7cc49b25ffd4e9f27b1e4a8e14ee0d7";
sha256 = "0nr74xv1ajvblvnl070l83zsr69nc1ws7fl2fvfjdq90kvwrz7in";
};
};
2019-05-12 19:09:30 -04:00
gazebo-ros = rosSuper.gazebo-ros.overrideAttrs ({ ... }:{
setupHook = ./gazebo-ros-setup-hook.sh;
});
2019-12-10 12:13:57 -05:00
gmapping = patchBoostSignals rosSuper.gmapping;
# These packages fail to build with testing disabled [1]. This has bee
# fixed upstream [2] but the patch is difficult to apply, so we just enable
# testing instead.
#
# [1] https://github.com/lopsided98/nix-ros-overlay/issues/160
# [2] https://github.com/husky/husky/pull/202
husky-control = rosSuper.husky-control.overrideAttrs ({ ... }: {
doCheck = true;
});
husky-description = rosSuper.husky-description.overrideAttrs ({ ... }: {
doCheck = true;
});
husky-navigation = rosSuper.husky-navigation.overrideAttrs ({ ... }: {
doCheck = true;
});
husky-viz = rosSuper.husky-viz.overrideAttrs ({ ... }: {
doCheck = true;
});
2019-12-08 12:27:01 -05:00
image-cb-detector = patchBoostSignals rosSuper.image-cb-detector;
laser-cb-detector = patchBoostSignals rosSuper.laser-cb-detector;
2019-05-12 19:09:30 -04:00
libfranka = rosSuper.libfranka.overrideAttrs ({
2021-05-30 10:35:02 -04:00
patches ? [], cmakeFlags ? [], ...
}: {
2021-05-30 10:35:02 -04:00
patches = patches ++ [ (self.fetchpatch {
url = "https://github.com/frankaemika/libfranka/commit/fbec4214e288d8dd941ddf6c192c9f6f9757d808.patch";
sha256 = "00n0xm8chsw16prh02prdn0n6rihpbjwn3jdqmj4l8rwwjdiq8d5";
}) ];
# Uses custom flag to disable tests. Attempts to download GTest without
# this.
cmakeFlags = cmakeFlags ++ [ "-DBUILD_TESTS=OFF" ];
});
2020-02-29 19:18:44 -05:00
libpcan = patchVendorUrl rosSuper.libpcan {
url = "http://www.peak-system.com/fileadmin/media/linux/files/peak-linux-driver-8.3.tar.gz";
sha256 = "0f6v3vjszyg1xp99jx48hyv8p32iyq4j18a4ir4x5p6f3b0z3r34";
};
2019-12-10 12:13:57 -05:00
libphidget21 = patchVendorUrl rosSuper.libphidget21 {
url = "https://www.phidgets.com/downloads/phidget21/libraries/linux/libphidget/libphidget_2.1.9.20190409.tar.gz";
sha256 = "07w54dmr75vq2imngfy66nk1sxlvkzhl2p6g362q0a02f099jy0f";
};
2019-12-10 14:50:16 -05:00
libphidgets = patchVendorUrl rosSuper.libphidgets {
url = "https://www.phidgets.com/downloads/phidget21/libraries/linux/libphidget/libphidget_2.1.8.20151217.tar.gz";
sha256 = "0lpaskqxpklm05050wwvdqwhw30f2hpzss8sgyvczdpvvqzjg4vk";
};
librealsense = rosSuper.librealsense.overrideAttrs ({
patches ? [], ...
}: {
2020-03-03 18:55:09 -05:00
patches = patches ++ [ (self.fetchpatch {
url = "https://github.com/IntelRealSense/librealsense/commit/86e434c86096b91a722f22bd039c2b6eeb8174ab.patch";
sha256 = "1kcvm32cx9zzd56k9yglnyxizmfgar3a6cybjdwpyf6ljrxjlpp5";
}) ];
});
2020-12-18 00:14:43 -05:00
librealsense2 = rosSuper.librealsense2.overrideAttrs ({
buildInputs ? [], ...
}: {
buildInputs = buildInputs ++ [ self.glfw self.libGLU ];
});
2020-03-03 18:38:25 -05:00
libuvc-camera = rosSuper.libuvc-camera.overrideAttrs ({
postPatch ? "", ...
}: {
postPatch = postPatch + ''
substituteInPlace cfg/UVCCamera.cfg --replace python2 python
'';
});
2019-04-08 17:28:23 -04:00
map-server = rosSuper.map-server.overrideAttrs ({
nativeBuildInputs ? [], ...
}: {
nativeBuildInputs = nativeBuildInputs ++ [ self.pkgconfig ];
});
2020-04-16 20:19:15 -04:00
mapviz = rosSuper.mapviz.overrideAttrs ({
nativeBuildInputs ? [],
postFixup ? "", ...
}: {
dontWrapQtApps = false;
2020-04-16 20:19:15 -04:00
nativeBuildInputs = nativeBuildInputs ++ [ self.qt5.wrapQtAppsHook ];
postFixup = postFixup + ''
wrapQtApp "$out/lib/mapviz/mapviz"
'';
});
2020-02-04 15:18:18 -05:00
mavlink = rosSuper.mavlink.overrideAttrs ({
2020-02-09 17:40:10 -05:00
postPatch ? "", ...
2020-02-04 15:18:18 -05:00
}: {
postPatch = postPatch + ''
substituteInPlace CMakeLists.txt --replace /usr/bin/env '${self.coreutils}/bin/env'
patchShebangs pymavlink/tools/mavgen.py
'';
2020-05-24 13:24:58 -04:00
ROS_PYTHON_VERSION = if rosSelf.python.isPy3k then 3 else 2;
});
message-filters = patchBoostSignals rosSuper.message-filters;
2019-04-18 01:55:44 -04:00
message-relay = rosSuper.message-relay.overrideAttrs ({
postPatch ? "", ...
}: {
postPatch = postPatch + ''
patchShebangs scripts
'';
});
2021-03-06 15:39:06 -05:00
open-manipulator-control-gui = rosSuper.open-manipulator-control-gui.overrideAttrs ({
nativeBuildInputs ? [], ...
}: {
dontWrapQtApps = false;
2021-03-06 15:39:06 -05:00
nativeBuildInputs = nativeBuildInputs ++ [ self.qt5.wrapQtAppsHook ];
postFixup = ''
wrapQtApp "$out/lib/open_manipulator_control_gui/open_manipulator_control_gui"
'';
});
plotjuggler = rosSuper.plotjuggler.overrideAttrs ({
nativeBuildInputs ? [], ...
}: {
dontWrapQtApps = false;
2021-03-06 15:39:06 -05:00
nativeBuildInputs = nativeBuildInputs ++ [ self.qt5.wrapQtAppsHook ];
});
pr2-tilt-laser-interface = patchBoostSignals rosSuper.pr2-tilt-laser-interface;
2019-04-08 17:28:23 -04:00
python-qt-binding = rosSuper.python-qt-binding.overrideAttrs ({
2019-04-06 16:26:04 -04:00
propagatedNativeBuildInputs ? [],
postPatch ? "", ...
}: {
propagatedNativeBuildInputs = propagatedNativeBuildInputs ++ [ rosSelf.pythonPackages.sip_4 ];
postPatch = ''
sed -e "1 i\\import PyQt5" \
-e "s#sipconfig\._pkg_config\['default_mod_dir'\], 'PyQt5'#PyQt5.__path__[0]#" \
-i cmake/sip_configure.py
'' + postPatch;
2019-04-06 16:26:04 -04:00
dontWrapQtApps = true;
2019-04-06 16:26:04 -04:00
setupHook = self.writeText "python-qt-binding-setup-hook" ''
_pythonQtBindingPreFixupHook() {
# Prevent /build RPATH references
rm -rf devel/lib
}
preFixupHooks+=(_pythonQtBindingPreFixupHook)
'';
2019-12-03 11:05:13 -05:00
});
2019-12-03 15:27:55 -05:00
roscpp = patchBoostSignals rosSuper.roscpp;
2020-06-24 18:48:21 -04:00
rmw-implementation = rosSuper.rmw-implementation.overrideAttrs ({
propagatedBuildInputs ? [], ...
}: {
# The default implementation must be available to all dependent packages
# at build time.
2020-09-16 18:49:00 -04:00
propagatedBuildInputs = with rosSelf; [
rmw-fastrtps-cpp
] ++ propagatedBuildInputs;
});
2021-11-24 15:55:11 -05:00
rqt-graph = rosSuper.rqt-graph.overrideAttrs ({
2021-11-25 13:00:06 -05:00
nativeBuildInputs ? [], postFixup ? "", ...
}: {
dontWrapQtApps = false;
2020-03-04 17:37:15 -05:00
nativeBuildInputs = nativeBuildInputs ++ [ self.qt5.wrapQtAppsHook ];
2021-11-25 13:00:06 -05:00
postFixup = postFixup + ''
2021-11-24 15:55:11 -05:00
wrapQtApp "$out/bin/rqt_graph"
2020-07-11 15:46:18 -04:00
'';
});
2021-11-24 15:55:11 -05:00
rqt-gui = rosSuper.rqt-gui.overrideAttrs ({
2021-11-25 13:00:06 -05:00
nativeBuildInputs ? [], postFixup ? "", ...
2021-11-17 20:35:53 -05:00
}: {
dontWrapQtApps = false;
nativeBuildInputs = nativeBuildInputs ++ [ self.qt5.wrapQtAppsHook ];
2021-11-25 13:00:06 -05:00
postFixup = postFixup + ''
2021-11-24 15:55:11 -05:00
wrapQtApp "$out/bin/rqt"
2021-11-17 20:35:53 -05:00
'';
});
rqt-msg = rosSuper.rqt-msg.overrideAttrs ({
2021-11-25 23:36:12 -05:00
nativeBuildInputs ? [], ...
2021-11-17 20:35:53 -05:00
}: {
dontWrapQtApps = false;
nativeBuildInputs = nativeBuildInputs ++ [ self.qt5.wrapQtAppsHook ];
});
rqt-plot = rosSuper.rqt-plot.overrideAttrs ({
2021-11-25 13:00:06 -05:00
nativeBuildInputs ? [], postFixup ? "", ...
2021-11-17 20:35:53 -05:00
}: {
dontWrapQtApps = false;
nativeBuildInputs = nativeBuildInputs ++ [ self.qt5.wrapQtAppsHook ];
2021-11-25 13:00:06 -05:00
postFixup = postFixup + ''
2021-11-17 20:35:53 -05:00
wrapQtApp "$out/bin/rqt_plot"
'';
});
rqt-publisher = rosSuper.rqt-publisher.overrideAttrs ({
nativeBuildInputs ? [], ...
}: {
dontWrapQtApps = false;
nativeBuildInputs = nativeBuildInputs ++ [ self.qt5.wrapQtAppsHook ];
});
rqt-py-console = rosSuper.rqt-py-console.overrideAttrs ({
nativeBuildInputs ? [], ...
}: {
dontWrapQtApps = false;
nativeBuildInputs = nativeBuildInputs ++ [ self.qt5.wrapQtAppsHook ];
});
rqt-reconfigure = rosSuper.rqt-reconfigure.overrideAttrs ({
nativeBuildInputs ? [], ...
}: {
dontWrapQtApps = false;
nativeBuildInputs = nativeBuildInputs ++ [ self.qt5.wrapQtAppsHook ];
});
rqt-service-caller = rosSuper.rqt-service-caller.overrideAttrs ({
nativeBuildInputs ? [], ...
}: {
dontWrapQtApps = false;
nativeBuildInputs = nativeBuildInputs ++ [ self.qt5.wrapQtAppsHook ];
});
rqt-shell = rosSuper.rqt-shell.overrideAttrs ({
2021-11-25 13:00:06 -05:00
nativeBuildInputs ? [], postFixup ? "", ...
2021-11-17 20:35:53 -05:00
}: {
dontWrapQtApps = false;
nativeBuildInputs = nativeBuildInputs ++ [ self.qt5.wrapQtAppsHook ];
2021-11-25 13:00:06 -05:00
postFixup = postFixup + ''
2021-11-17 20:35:53 -05:00
wrapQtApp "$out/bin/rqt_shell"
'';
});
rqt-srv = rosSuper.rqt-srv.overrideAttrs ({
2021-11-25 13:00:06 -05:00
nativeBuildInputs ? [], postFixup ? "", ...
2021-11-17 20:35:53 -05:00
}: {
dontWrapQtApps = false;
nativeBuildInputs = nativeBuildInputs ++ [ self.qt5.wrapQtAppsHook ];
});
rqt-top = rosSuper.rqt-top.overrideAttrs ({
nativeBuildInputs ? [], ...
}: {
dontWrapQtApps = false;
nativeBuildInputs = nativeBuildInputs ++ [ self.qt5.wrapQtAppsHook ];
});
rqt-topic = rosSuper.rqt-topic.overrideAttrs ({
nativeBuildInputs ? [], ...
}: {
dontWrapQtApps = false;
nativeBuildInputs = nativeBuildInputs ++ [ self.qt5.wrapQtAppsHook ];
});
2019-09-06 00:44:00 -04:00
rviz = rosSuper.rviz.overrideAttrs ({
2021-11-25 13:00:06 -05:00
nativeBuildInputs ? [], postFixup ? "", ...
}: {
dontWrapQtApps = false;
2020-03-04 17:37:15 -05:00
nativeBuildInputs = nativeBuildInputs ++ [ self.qt5.wrapQtAppsHook ];
2021-11-25 13:00:06 -05:00
postFixup = postFixup + ''
2021-01-27 18:43:08 +08:00
wrapQtApp "$out/lib/rviz/rviz"
'';
});
rviz-ogre-vendor = rosSuper.rviz-ogre-vendor.overrideAttrs ({
2019-09-06 00:44:00 -04:00
preFixup ? "", ...
}: {
dontFixCmake = true;
preFixup = ''
2019-09-06 11:41:12 -04:00
# Prevent /build RPATH references
2019-09-06 00:44:00 -04:00
rm -r ogre_install
'' + preFixup;
});
2019-12-08 00:00:12 -05:00
rxcpp-vendor = patchVendorUrl rosSuper.rxcpp-vendor {
2019-09-06 15:03:45 -04:00
url = "https://github.com/ReactiveX/RxCpp/archive/v4.1.0.tar.gz";
sha256 = "1smxrcm0s6bz05185dx1i2xjgn47rq7m247pblil6p3bmk3lkfyk";
};
2019-12-08 00:00:12 -05:00
shared-queues-vendor = patchVendorUrl (patchVendorUrl rosSuper.shared-queues-vendor {
2019-09-06 00:44:00 -04:00
url = "https://github.com/cameron314/concurrentqueue/archive/8f65a8734d77c3cc00d74c0532efca872931d3ce.zip";
sha256 = "0cmsmgc87ndd9hiv187xkvjkn8fipn3hsijjc864h2lfcyigbxq1";
}) {
url = "https://github.com/cameron314/readerwriterqueue/archive/ef7dfbf553288064347d51b8ac335f1ca489032a.zip";
sha256 = "1255n51y1bjry97n4w60mgz6b9h14flfrxb01ihjf6pwvvfns8ag";
};
2021-03-06 15:39:06 -05:00
swri-profiler-tools = rosSuper.swri-profiler-tools.overrideAttrs ({
nativeBuildInputs ? [], ...
}: {
dontWrapQtApps = false;
2021-03-06 15:39:06 -05:00
nativeBuildInputs = nativeBuildInputs ++ [ self.qt5.wrapQtAppsHook ];
postFixup = ''
wrapQtApp "$out/lib/swri_profiler_tools/profiler"
'';
});
2020-04-16 20:19:15 -04:00
swri-transform-util = rosSuper.swri-transform-util.overrideAttrs ({
CXXFLAGS ? "", ...
}: {
CXXFLAGS = CXXFLAGS + " -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H";
});
2019-12-08 01:04:42 -05:00
tf = patchBoostSignals rosSuper.tf;
2019-12-03 15:27:55 -05:00
tf2 = patchBoostSignals rosSuper.tf2;
2019-12-08 00:00:12 -05:00
tinydir-vendor = patchVendorUrl rosSuper.tinydir-vendor {
url = "https://github.com/cxong/tinydir/archive/1.2.4.tar.gz";
sha256 = "1qjwky7v4b9d9dmxzsybnhiz6xgx94grc67sdyvlp1d4kfkfsl4w";
};
2021-03-06 13:20:00 -05:00
turtlesim = rosSuper.turtlesim.overrideAttrs ({
nativeBuildInputs ? [], ...
}: {
dontWrapQtApps = false;
2021-03-06 13:20:00 -05:00
nativeBuildInputs = nativeBuildInputs ++ [ self.qt5.wrapQtAppsHook ];
postFixup = ''
wrapQtApp "$out/lib/turtlesim/turtlesim_node"
'';
});
2019-12-08 00:00:12 -05:00
uncrustify-vendor = patchVendorUrl rosSuper.uncrustify-vendor {
url = "https://github.com/uncrustify/uncrustify/archive/uncrustify-0.68.1.tar.gz";
sha256 = "04ndwhcn9iv3cy4p5wgh5z0vx2sywqlydyympn9m3h5458w1aijh";
};
yaml-cpp-vendor = patchVendorUrl rosSuper.yaml-cpp-vendor {
url = "https://github.com/jbeder/yaml-cpp/archive/0f9a586ca1dc29c2ecb8dd715a315b93e3f40f79.zip";
sha256 = "1g45f71mk4gyca550177qf70v5cvavlsalmg7x8bi59j6z6f0mgz";
};
};
in self.lib.makeExtensible (rosSelf: self.rosPackages.lib.mergeOverlays [
base
(import (./. + "/${distro}/generated.nix"))
overrides
(import (./. + "/${distro}/overrides.nix") self)
] rosSelf {})