mirror of
https://github.com/lopsided98/nix-ros-overlay.git
synced 2025-06-10 17:54:49 +03:00
215 lines
7.2 KiB
Nix
215 lines
7.2 KiB
Nix
{ distro, python }:
|
|
self: super:
|
|
let
|
|
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;
|
|
};
|
|
|
|
inherit python;
|
|
pythonPackages = rosSelf.python.pkgs;
|
|
|
|
boost = self.boost.override {
|
|
python = rosSelf.python;
|
|
enablePython = true;
|
|
};
|
|
};
|
|
|
|
overrides = rosSelf: rosSuper: with rosSelf.lib; {
|
|
# ROS package overrides/fixups
|
|
|
|
ament-cmake-core = rosSuper.ament-cmake-core.overrideAttrs ({
|
|
propagatedBuildInputs ? [], ...
|
|
}: {
|
|
propagatedBuildInputs = [ self.cmake rosSelf.ament-package ] ++ propagatedBuildInputs;
|
|
setupHook = ./ament-cmake-core-setup-hook.sh;
|
|
});
|
|
|
|
camera-calibration-parsers = patchBoostPython rosSuper.camera-calibration-parsers;
|
|
|
|
catkin = rosSuper.catkin.overrideAttrs ({
|
|
propagatedBuildInputs ? [],
|
|
prePhases ? [],
|
|
postPatch ? "", ...
|
|
}: let
|
|
setupHook = self.callPackage ./catkin-setup-hook { } distro;
|
|
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"
|
|
'';
|
|
});
|
|
|
|
# Packages that depend on catkin-pip still fail because they try to
|
|
# download from the internet, but it should work outside of Nix builds.
|
|
catkin-pip = rosSuper.catkin-pip.overrideAttrs ({
|
|
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 ""
|
|
'';
|
|
});
|
|
|
|
cv-bridge = (patchBoostPython rosSuper.cv-bridge).overrideAttrs ({
|
|
propagatedBuildInputs ? [], ...
|
|
}: {
|
|
propagatedBuildInputs = propagatedBuildInputs ++ [ rosSelf.pythonPackages.opencv3 ];
|
|
});
|
|
|
|
dynamic-reconfigure = rosSuper.dynamic-reconfigure.overrideAttrs ({
|
|
postPatch ? "", ...
|
|
}: {
|
|
postPatch = postPatch + ''
|
|
substituteInPlace cmake/setup_custom_pythonpath.sh.in \
|
|
--replace '#!/usr/bin/env sh' '#!${self.stdenv.shell}'
|
|
'';
|
|
});
|
|
|
|
fmilibrary-vendor = patchVendorUrl rosSuper.fmilibrary-vendor {
|
|
url = "https://jmodelica.org/fmil/FMILibrary-2.0.3-src.zip";
|
|
sha256 = "16lx6355zskrb7wgw2bzdzms36pcjyl2ry03wgsac5215jg1zhjc";
|
|
};
|
|
|
|
gazebo-ros = rosSuper.gazebo-ros.overrideAttrs ({ ... }:{
|
|
setupHook = ./gazebo-ros-setup-hook.sh;
|
|
});
|
|
|
|
libyaml-vendor = patchVendorUrl rosSuper.libyaml-vendor {
|
|
url = "https://github.com/yaml/libyaml/archive/10c907871f1ccd779c7fccf6b81a62762b5c4e7b.zip";
|
|
sha256 = "0v6ks4hpxmakgymcfvafynla76gl3866grgwf4vjdsb4rsvr13vx";
|
|
};
|
|
|
|
map-server = rosSuper.map-server.overrideAttrs ({
|
|
nativeBuildInputs ? [], ...
|
|
}: {
|
|
nativeBuildInputs = nativeBuildInputs ++ [ self.pkgconfig ];
|
|
});
|
|
|
|
message-filters = patchBoostSignals rosSuper.message-filters;
|
|
|
|
message-relay = rosSuper.message-relay.overrideAttrs ({
|
|
postPatch ? "", ...
|
|
}: {
|
|
postPatch = postPatch + ''
|
|
patchShebangs scripts
|
|
'';
|
|
});
|
|
|
|
python-qt-binding = rosSuper.python-qt-binding.overrideAttrs ({
|
|
propagatedNativeBuildInputs ? [],
|
|
postPatch ? "", ...
|
|
}: {
|
|
propagatedNativeBuildInputs = propagatedNativeBuildInputs ++ [ rosSelf.pythonPackages.sip ];
|
|
postPatch = ''
|
|
sed -e "s#sipconfig\._pkg_config\['default_sip_dir'\]#'${rosSelf.pythonPackages.pyqt5}/share/sip'#" \
|
|
-e "s#qtconfig\['QT_INSTALL_HEADERS'\]#'${self.qt5.qtbase.dev}/include'#g" \
|
|
-i cmake/sip_configure.py
|
|
'' + postPatch;
|
|
|
|
setupHook = self.writeText "python-qt-binding-setup-hook" ''
|
|
_pythonQtBindingPreFixupHook() {
|
|
# Prevent /build RPATH references
|
|
rm -rf devel/lib
|
|
}
|
|
preFixupHooks+=(_pythonQtBindingPreFixupHook)
|
|
'';
|
|
});
|
|
|
|
roscpp = patchBoostSignals rosSuper.roscpp;
|
|
|
|
rosidl-default-runtime = rosSuper.rosidl-default-runtime.overrideAttrs ({
|
|
propagatedBuildInputs ? [], ...
|
|
}: {
|
|
propagatedBuildInputs = [ rosSelf.rmw-fastrtps-cpp ] ++ propagatedBuildInputs;
|
|
});
|
|
|
|
rqt-gui = rosSuper.rqt-gui.overrideAttrs ({
|
|
nativeBuildInputs ? [],
|
|
postFixup ? "", ...
|
|
}: {
|
|
nativeBuildInputs = nativeBuildInputs ++ [ self.makeWrapper ];
|
|
|
|
postFixup = ''
|
|
wrapProgram $out/bin/rqt \
|
|
--prefix QT_PLUGIN_PATH : "${self.qt5.qtbase.bin}/${self.qt5.qtbase.qtPluginPrefix}"
|
|
'' + postFixup;
|
|
});
|
|
|
|
rviz = rosSuper.rviz.overrideAttrs ({
|
|
nativeBuildInputs ? [],
|
|
postFixup ? "", ...
|
|
}: {
|
|
nativeBuildInputs = nativeBuildInputs ++ [ self.makeWrapper ];
|
|
|
|
postFixup = ''
|
|
wrapProgram $out/bin/rviz \
|
|
--prefix QT_PLUGIN_PATH : "${self.qt5.qtbase.bin}/${self.qt5.qtbase.qtPluginPrefix}"
|
|
'' + postFixup;
|
|
});
|
|
|
|
rviz-ogre-vendor = (patchVendorUrl rosSuper.rviz-ogre-vendor {
|
|
url = "https://github.com/OGRECave/ogre/archive/v1.10.12.zip";
|
|
sha256 = "1nafqazv396y97z0rgrn0dmkddq7y4zgfszvmi3aw6hr6zwyrpa3";
|
|
}).overrideAttrs ({
|
|
preFixup ? "", ...
|
|
}: {
|
|
dontFixCmake = true;
|
|
preFixup = ''
|
|
# Prevent /build RPATH references
|
|
rm -r ogre_install
|
|
'' + preFixup;
|
|
});
|
|
|
|
rxcpp-vendor = patchVendorUrl rosSuper.rxcpp-vendor {
|
|
url = "https://github.com/ReactiveX/RxCpp/archive/v4.1.0.tar.gz";
|
|
sha256 = "1smxrcm0s6bz05185dx1i2xjgn47rq7m247pblil6p3bmk3lkfyk";
|
|
};
|
|
|
|
shared-queues-vendor = patchVendorUrl (patchVendorUrl rosSuper.shared-queues-vendor {
|
|
url = "https://github.com/cameron314/concurrentqueue/archive/8f65a8734d77c3cc00d74c0532efca872931d3ce.zip";
|
|
sha256 = "0cmsmgc87ndd9hiv187xkvjkn8fipn3hsijjc864h2lfcyigbxq1";
|
|
}) {
|
|
url = "https://github.com/cameron314/readerwriterqueue/archive/ef7dfbf553288064347d51b8ac335f1ca489032a.zip";
|
|
sha256 = "1255n51y1bjry97n4w60mgz6b9h14flfrxb01ihjf6pwvvfns8ag";
|
|
};
|
|
|
|
tf = patchBoostSignals rosSuper.tf;
|
|
|
|
tf2 = patchBoostSignals rosSuper.tf2;
|
|
|
|
tinydir-vendor = patchVendorUrl rosSuper.tinydir-vendor {
|
|
url = "https://github.com/cxong/tinydir/archive/1.2.4.tar.gz";
|
|
sha256 = "1qjwky7v4b9d9dmxzsybnhiz6xgx94grc67sdyvlp1d4kfkfsl4w";
|
|
};
|
|
|
|
uncrustify-vendor = patchVendorUrl rosSuper.uncrustify-vendor {
|
|
url = "https://github.com/uncrustify/uncrustify/archive/uncrustify-0.68.1.tar.gz";
|
|
sha256 = "04ndwhcn9iv3cy4p5wgh5z0vx2sywqlydyympn9m3h5458w1aijh";
|
|
};
|
|
|
|
urdf = patchBoostPython rosSuper.urdf;
|
|
|
|
yaml-cpp-vendor = patchVendorUrl rosSuper.yaml-cpp-vendor {
|
|
url = "https://github.com/jbeder/yaml-cpp/archive/0f9a586ca1dc29c2ecb8dd715a315b93e3f40f79.zip";
|
|
sha256 = "1g45f71mk4gyca550177qf70v5cvavlsalmg7x8bi59j6z6f0mgz";
|
|
};
|
|
};
|
|
in self.rosPackages.lib.mkOverlay [
|
|
base
|
|
(import (./. + "/${distro}/generated.nix"))
|
|
overrides
|
|
(import (./. + "/${distro}/overrides.nix") self)
|
|
]
|