Skip to content
66 changes: 62 additions & 4 deletions distros/distro-overlay.nix
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ let

# Switch to Qt6 for python 3.13
python-qt-binding = rosSuper.python-qt-binding.overrideAttrs ({
patches ? [], propagatedBuildInputs ? [], ...
patches ? [], propagatedBuildInputs ? [], postPatch ? "", ...
}: {
patches = patches ++ [
# ref. https://github.com/ros-visualization/python_qt_binding/pull/143
Expand All @@ -191,10 +191,27 @@ let
hash = "sha256-+ou08BZCIhRMDi9GMyAOLmdoGJNZaqLpA7nMszZOFgg=";
})
];
propagatedBuildInputs = propagatedBuildInputs ++ (with rosSelf.pythonPackages; [
# PySide6 libs are eg. PySide6/QtGui.abi3.so.1, not libpyside6_QtGui.abi3.so
postPatch = postPatch + ''
substituteInPlace cmake/pyside_config.py \
--replace-fail \
"return glob if sys.platform == 'win32' else 'lib' + glob" \
"return glob" \
--replace-fail \
"return 'so.*'" \
"return 'so*'" \
--replace-fail \
"'shiboken' in basename" \
"'shiboken6' == os.path.basename(os.path.dirname(lib_name))" \
--replace-fail \
"'pyside6' in basename" \
"'PySide6' == os.path.basename(os.path.dirname(lib_name))"
'';
propagatedBuildInputs = self.lib.lists.filter (p: p.name != "pyqt5") (propagatedBuildInputs ++ (with rosSelf.pythonPackages; [
pyside6
pyqt6-sip
]);
shiboken6
]));

dontWrapQtApps = true;

Expand Down Expand Up @@ -256,10 +273,51 @@ let
'';
});

qt-gui= rosSuper.qt-gui.overrideAttrs ({
propagatedBuildInputs ? [], ...
}: {
propagatedBuildInputs = self.lib.lists.filter (p: p.name != "pyqt5") propagatedBuildInputs;
});

qt-gui-cpp = rosSuper.qt-gui-cpp.overrideAttrs (
{
patches ? [ ],
propagatedBuildInputs ? [ ],
nativeBuildInputs ? [ ],
...
}:
{
patches = patches ++ [
# ref. https://github.com/ros-visualization/qt_gui_core/pull/309, just to allow the other patch to apply
(self.fetchpatch {
url = "https://github.com/ros-visualization/qt_gui_core/commit/d07b80eac7657fe56b6581e94fa67b91056715a2.patch";
hash = "sha256-99nUTiYqUm6R+YmM0hfk3+C3uyzHqmW8b8xkb+oM6TY=";
stripLen = 1;
revert = true;
})
# Qt 5 -> 6
# ref. https://github.com/ros-visualization/qt_gui_core/pull/293
(self.fetchpatch {
url = "https://github.com/ros-visualization/qt_gui_core/commit/21941697c5584dc73968a8b50c51df2aef929562.patch";
hash = "sha256-4MO4X0AyK9X7UsVBxVosR9bx+62tZgXgJ3a6n2q5E1A=";
stripLen = 1;
})
];
nativeBuildInputs = nativeBuildInputs ++ [ self.breakpointHook ];
propagatedBuildInputs = propagatedBuildInputs ++ [ rosSelf.tinyxml2-vendor ]
++ (with rosSelf.pythonPackages; [
pyside6
pyqt6-sip
shiboken6
]);
}
);

rqt-image-view = rosSuper.rqt-image-view.overrideAttrs ({
nativeBuildInputs ? [], postFixup ? "", ...
buildInputs ? [], nativeBuildInputs ? [], postFixup ? "", ...
}: {
dontWrapQtApps = false;
buildInputs = super.lib.lists.filter (p: p.pname != "qtbase") buildInputs;
nativeBuildInputs = nativeBuildInputs ++ [ self.qt5.wrapQtAppsHook ];
postFixup = postFixup + ''
wrapQtApp "$out/lib/rqt_image_view/rqt_image_view"
Expand Down
4 changes: 2 additions & 2 deletions distros/rolling/gz-gui-vendor/vendored-source.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"gz_gui_vendor": {
"url": "https://github.com/gazebosim/gz-gui.git",
"rev": "gz-gui9_9.0.1",
"hash": "sha256-ZBDgd37TPBOldorGZimsCk57fVa7tTc8wRwUGFBZnDk="
"rev": "gz-gui10_10.0.0",
"hash": "sha256-s34FtTFWV6+qakYz6atZfl20y7u8KQAU58a63FghhKc="
}
}
4 changes: 2 additions & 2 deletions distros/rolling/gz-launch-vendor/vendored-source.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"gz_launch_vendor": {
"url": "https://github.com/gazebosim/gz-launch.git",
"rev": "gz-launch8_8.0.1",
"hash": "sha256-el+4sVBOmeBj8VJqKut8pIhVJeyEyodrt6titunbBF0="
"rev": "gz-launch9_9.0.0",
"hash": "sha256-fRzRFsnhK0IiOLNyB9JrYgX0D2vPXQ7rxp7JXCMd3hQ="
}
}
4 changes: 2 additions & 2 deletions distros/rolling/gz-sim-vendor/vendored-source.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"gz_sim_vendor": {
"url": "https://github.com/gazebosim/gz-sim.git",
"rev": "gz-sim9_9.1.0",
"hash": "sha256-niVXuqMvEhwCW2NcrEhIChh3DsD2M8ZTspDi+zF0kBc="
"rev": "gz-sim10_10.0.0",
"hash": "sha256-bdirXA6m7dHcAWDbaWfxabURm541DaYFSz81j4+kiG8="
}
}
72 changes: 55 additions & 17 deletions distros/rolling/overrides.nix
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ in {
'';
});

freeimage = if lib.isDerivation self.freeimage then null else
builtins.abort "Remove this override as freeimage was removed from nixpkgs";

gazebo = self.gazebo_11;

geometric-shapes = rosSuper.geometric-shapes.overrideAttrs({
Expand Down Expand Up @@ -85,7 +88,22 @@ in {

gz-cmake-vendor = lib.patchAmentVendorGit rosSuper.gz-cmake-vendor { };

gz-common-vendor = (lib.patchAmentVendorGit rosSuper.gz-common-vendor { }).overrideAttrs ({
gz-common-vendor = (lib.patchAmentVendorGit rosSuper.gz-common-vendor {
patchesFor.gz_common_vendor = [
# Patch needed for the #725 below to apply cleanly
(self.fetchpatch2 {
name = "fix-image-channeldata-for-16-bit-rgb-a-images";
url = "https://github.com/gazebosim/gz-common/commit/58c6eaa7bd9c048264f3e0b33a36a744cca8d18c.patch";
hash = "sha256-y2fQp6IdEykIgS/vMMN4rTctY0btBQy+vLI1mlaQKJc=";
})
# https://github.com/gazebosim/gz-common/pull/725
(self.fetchpatch2 {
name = "replace-freeimage-dependency-with-stb-rolling-version";
url = "https://github.com/wentasah/gz-common/commit/8d18342302b7586b5b34c3cd12f2ef26e148b6ab.patch";
hash = "sha256-rI9hqtbwYWhakIo1I8DEElbMZYkchG4lzUUt8lr8XnU=";
})
];
}).overrideAttrs ({
nativeBuildInputs ? [], ...
}: {
# https://github.com/gazebo-release/gz_common_vendor/pull/2
Expand All @@ -96,17 +114,9 @@ in {

gz-fuel-tools-vendor = lib.patchAmentVendorGit rosSuper.gz-fuel-tools-vendor { };

gz-gui-vendor = (lib.patchGzAmentVendorGit rosSuper.gz-gui-vendor { }).overrideAttrs ({
postInstall ? "", ...
}: {
# "RPATH of binary libGrid3D.so contains a forbidden reference to
# /build/" (see https://github.com/gazebosim/gz-gui/issues/627).
postInstall = postInstall + ''
${self.patchelf}/bin/patchelf --remove-rpath $out/lib64/gz-gui-9/plugins/libGrid3D.so
'';
});
gz-gui-vendor = lib.patchAmentVendorGit rosSuper.gz-gui-vendor { };

gz-launch-vendor = lib.patchGzAmentVendorGit rosSuper.gz-launch-vendor { };
gz-launch-vendor = lib.patchAmentVendorGit rosSuper.gz-launch-vendor { };

gz-math-vendor = lib.patchAmentVendorGit rosSuper.gz-math-vendor { };

Expand All @@ -120,23 +130,26 @@ in {

gz-plugin-vendor = lib.patchAmentVendorGit rosSuper.gz-plugin-vendor { };

gz-rendering-vendor = lib.patchAmentVendorGit rosSuper.gz-rendering-vendor { };
gz-rendering-vendor = (lib.patchAmentVendorGit rosSuper.gz-rendering-vendor { }).overrideAttrs({
nativeBuildInputs ? [],
...
}: {
nativeBuildInputs = nativeBuildInputs ++ [ self.pkg-config ];
});

gz-sensors-vendor = lib.patchAmentVendorGit rosSuper.gz-sensors-vendor { };

gz-sim-vendor = lib.patchGzAmentVendorGit rosSuper.gz-sim-vendor { };
gz-sim-vendor = lib.patchAmentVendorGit rosSuper.gz-sim-vendor { };

gz-tools-vendor = (lib.patchAmentVendorGit rosSuper.gz-tools-vendor { }).overrideAttrs({
nativeBuildInputs ? [],
propagatedNativeBuildInputs ? [],
qtWrapperArgs ? [],
postFixup ? "", ...
}: {
nativeBuildInputs = nativeBuildInputs ++ [ self.qt5.wrapQtAppsHook ];
nativeBuildInputs = nativeBuildInputs ++ [ self.qt6.wrapQtAppsHook ];
propagatedNativeBuildInputs = propagatedNativeBuildInputs ++ [
self.qt5.qtquickcontrols2
self.qt5.qtgraphicaleffects
self.pkg-config
self.qt6.qtbase
];
qtWrapperArgs = qtWrapperArgs ++ [
# Gazebo is currently broken on Wayland
Expand Down Expand Up @@ -358,4 +371,29 @@ in {
export NIX_ZENOH_OPAQUE_TYPES_CARGO_CONFIG=$PWD/nix-zenoh-opaque-types/.cargo/config.toml
'';
});

gz = rosSelf.buildEnv {
name = "gz";
paths = with rosSelf; [
gz-cmake-vendor
gz-common-vendor
gz-fuel-tools-vendor
gz-gui-vendor
gz-launch-vendor
gz-math-vendor
gz-msgs-vendor
gz-physics-vendor
gz-plugin-vendor
gz-rendering-vendor
gz-sensors-vendor
gz-sim-vendor
gz-tools-vendor
gz-transport-vendor
gz-utils-vendor
sdformat-vendor
gz-dartsim-vendor
gz-ogre-next-vendor
self.qt6.wrapQtAppsHook
];
};
}
1 change: 1 addition & 0 deletions distros/ros2-overlay.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ rosSelf: rosSuper: with rosSelf.lib; {
# TODO: remove once https://github.com/ros/rosdistro/pull/43895 is merged
python = rosSelf.python3;
pythonPackages = rosSelf.python.pkgs;
qt5 = self.qt6;

ament-cmake-core = rosSuper.ament-cmake-core.overrideAttrs ({
propagatedBuildInputs ? [],
Expand Down
5 changes: 0 additions & 5 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,4 @@
};
};

nixConfig = {
extra-substituters = [ "https://ros.cachix.org" ];
extra-trusted-public-keys = [ "ros.cachix.org-1:dSyZxI8geDCJrwgvCOHDoAfOm5sV1wCPjBkKL+38Rvo=" ];
};

}
2 changes: 0 additions & 2 deletions pkgs/ogre/1.9.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
, libGLU
, libGL
, freetype
, freeimage
, zziplib
, xorgproto
, libXrandr
Expand Down Expand Up @@ -62,7 +61,6 @@ stdenv.mkDerivation rec {
libGLU
libGL
freetype
freeimage
zziplib
xorgproto
libXrandr
Expand Down