diff --git a/distros/distro-overlay.nix b/distros/distro-overlay.nix index 9415b21647..81595e1c87 100644 --- a/distros/distro-overlay.nix +++ b/distros/distro-overlay.nix @@ -104,7 +104,7 @@ let nativeBuildInputs ? [], postFixup ? "", ... }: { dontWrapQtApps = false; - nativeBuildInputs = nativeBuildInputs ++ [ self.qt5.wrapQtAppsHook ]; + nativeBuildInputs = nativeBuildInputs ++ [ self.qt6.wrapQtAppsHook ]; postFixup = postFixup + '' wrapQtApp "$out/lib/joint_state_publisher_gui/joint_state_publisher_gui" ''; @@ -121,7 +121,7 @@ let postFixup ? "", ... }: { dontWrapQtApps = false; - nativeBuildInputs = nativeBuildInputs ++ [ self.qt5.wrapQtAppsHook ]; + nativeBuildInputs = nativeBuildInputs ++ [ self.qt6.wrapQtAppsHook ]; postFixup = postFixup + '' wrapQtApp "$out/lib/mapviz/mapviz" ''; @@ -163,7 +163,7 @@ let nativeBuildInputs ? [], ... }: { dontWrapQtApps = false; - nativeBuildInputs = nativeBuildInputs ++ [ self.qt5.wrapQtAppsHook ]; + nativeBuildInputs = nativeBuildInputs ++ [ self.qt6.wrapQtAppsHook ]; postFixup = '' wrapQtApp "$out/lib/plotjuggler/plotjuggler" ''; @@ -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 @@ -191,10 +191,26 @@ let hash = "sha256-+ou08BZCIhRMDi9GMyAOLmdoGJNZaqLpA7nMszZOFgg="; }) ]; - propagatedBuildInputs = propagatedBuildInputs ++ (with rosSelf.pythonPackages; [ + # avoid cmake/pyside_config.py and use the proper PySide6Config.cmake + postPatch = postPatch + '' + substituteInPlace cmake/shiboken_helper.cmake \ + --replace-fail "Shiboken2" "Shiboken6" \ + --replace-fail "shiboken2" "shiboken6" \ + --replace-fail "PySide2" "PySide6" \ + --replace-fail "pyside2" "pyside6" \ + --replace-fail "Shiboken6::shiboken6" "${rosSelf.pythonPackages.shiboken6}/bin/shiboken6" \ + --replace-fail \ + "/usr/local/lib/python3.12/dist-packages/PySide6/typesystems/" \ + "${rosSelf.pythonPackages.pyside6}/share/PySide6/typesystems" \ + --replace-fail \ + "if($""{QT_VERSION_MAJOR} GREATER \"5\")" \ + "if(FALSE)" + ''; + propagatedBuildInputs = self.lib.lists.filter (p: p.pname != "pyqt5") (propagatedBuildInputs ++ (with rosSelf.pythonPackages; [ pyside6 pyqt6-sip - ]); + shiboken6 + ])); dontWrapQtApps = true; @@ -211,7 +227,7 @@ let nativeBuildInputs ? [], postFixup ? "", ... }: { dontWrapQtApps = false; - nativeBuildInputs = nativeBuildInputs ++ [ self.qt5.wrapQtAppsHook ]; + nativeBuildInputs = nativeBuildInputs ++ [ self.qt6.wrapQtAppsHook ]; postFixup = postFixup + '' wrapQtApp "$out/bin/rqt_bag" wrapQtApp "$out/lib/rqt_bag/rqt_bag" @@ -222,7 +238,7 @@ let nativeBuildInputs ? [], postFixup ? "", ... }: { dontWrapQtApps = false; - nativeBuildInputs = nativeBuildInputs ++ [ self.qt5.wrapQtAppsHook ]; + nativeBuildInputs = nativeBuildInputs ++ [ self.qt6.wrapQtAppsHook ]; postFixup = postFixup + '' wrapQtApp "$out/lib/rqt_console/rqt_console" ''; @@ -232,7 +248,7 @@ let nativeBuildInputs ? [], postFixup ? "", ... }: { dontWrapQtApps = false; - nativeBuildInputs = nativeBuildInputs ++ [ self.qt5.wrapQtAppsHook ]; + nativeBuildInputs = nativeBuildInputs ++ [ self.qt6.wrapQtAppsHook ]; postFixup = postFixup + '' wrapQtApp "$out/lib/rqt_graph/rqt_graph" if [[ -e "$out/bin/rqt_graph" ]]; then @@ -246,31 +262,64 @@ let }); rqt-gui = rosSuper.rqt-gui.overrideAttrs ({ - nativeBuildInputs ? [], postFixup ? "", ... + buildInputs ? [], nativeBuildInputs ? [], postFixup ? "", ... }: { dontWrapQtApps = false; - nativeBuildInputs = nativeBuildInputs ++ [ self.qt5.wrapQtAppsHook ]; + buildInputs = buildInputs ++ [ self.qt6.qtbase ]; + nativeBuildInputs = nativeBuildInputs ++ [ self.qt6.wrapQtAppsHook ]; postFixup = postFixup + '' wrapQtApp "$out/bin/rqt" wrapQtApp "$out/lib/rqt_gui/rqt_gui" ''; }); - rqt-image-view = rosSuper.rqt-image-view.overrideAttrs ({ - nativeBuildInputs ? [], postFixup ? "", ... + qt-gui = rosSuper.qt-gui.overrideAttrs ({ + buildInputs ? [], propagatedBuildInputs ? [], ... }: { - dontWrapQtApps = false; - nativeBuildInputs = nativeBuildInputs ++ [ self.qt5.wrapQtAppsHook ]; - postFixup = postFixup + '' - wrapQtApp "$out/lib/rqt_image_view/rqt_image_view" - ''; + buildInputs = self.lib.lists.filter (p: p.pname != "pyqt5") buildInputs; }); + 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 = self.hello; # porting to Qt6 require some work, ignoring for now + rqt-msg = rosSuper.rqt-msg.overrideAttrs ({ nativeBuildInputs ? [], postFixup ? "", ... }: { dontWrapQtApps = false; - nativeBuildInputs = nativeBuildInputs ++ [ self.qt5.wrapQtAppsHook ]; + nativeBuildInputs = nativeBuildInputs ++ [ self.qt6.wrapQtAppsHook ]; postFixup = postFixup + '' wrapQtApp "$out/lib/rqt_msg/rqt_msg" ''; @@ -280,7 +329,7 @@ let nativeBuildInputs ? [], postFixup ? "", ... }: { dontWrapQtApps = false; - nativeBuildInputs = nativeBuildInputs ++ [ self.qt5.wrapQtAppsHook ]; + nativeBuildInputs = nativeBuildInputs ++ [ self.qt6.wrapQtAppsHook ]; postFixup = postFixup + '' wrapQtApp "$out/lib/rqt_plot/rqt_plot" ''; @@ -290,7 +339,7 @@ let nativeBuildInputs ? [], postFixup ? "", ... }: { dontWrapQtApps = false; - nativeBuildInputs = nativeBuildInputs ++ [ self.qt5.wrapQtAppsHook ]; + nativeBuildInputs = nativeBuildInputs ++ [ self.qt6.wrapQtAppsHook ]; postFixup = postFixup + '' wrapQtApp "$out/lib/rqt_publisher/rqt_publisher" ''; @@ -300,7 +349,7 @@ let nativeBuildInputs ? [], postFixup ? "", ... }: { dontWrapQtApps = false; - nativeBuildInputs = nativeBuildInputs ++ [ self.qt5.wrapQtAppsHook ]; + nativeBuildInputs = nativeBuildInputs ++ [ self.qt6.wrapQtAppsHook ]; postFixup = postFixup + '' wrapQtApp "$out/lib/rqt_py_console/rqt_py_console" ''; @@ -310,7 +359,7 @@ let nativeBuildInputs ? [], postFixup ? "", ... }: { dontWrapQtApps = false; - nativeBuildInputs = nativeBuildInputs ++ [ self.qt5.wrapQtAppsHook ]; + nativeBuildInputs = nativeBuildInputs ++ [ self.qt6.wrapQtAppsHook ]; postFixup = postFixup + '' wrapQtApp "$out/lib/rqt_reconfigure/rqt_reconfigure" ''; @@ -320,7 +369,7 @@ let nativeBuildInputs ? [], postFixup ? "", ... }: { dontWrapQtApps = false; - nativeBuildInputs = nativeBuildInputs ++ [ self.qt5.wrapQtAppsHook ]; + nativeBuildInputs = nativeBuildInputs ++ [ self.qt6.wrapQtAppsHook ]; postFixup = postFixup + '' wrapQtApp "$out/lib/rqt_robot_monitor/rqt_robot_monitor" ''; @@ -330,7 +379,7 @@ let nativeBuildInputs ? [], postFixup ? "", ... }: { dontWrapQtApps = false; - nativeBuildInputs = nativeBuildInputs ++ [ self.qt5.wrapQtAppsHook ]; + nativeBuildInputs = nativeBuildInputs ++ [ self.qt6.wrapQtAppsHook ]; postFixup = postFixup + '' wrapQtApp "$out/lib/rqt_service_caller/rqt_service_caller" ''; @@ -340,7 +389,7 @@ let nativeBuildInputs ? [], postFixup ? "", ... }: { dontWrapQtApps = false; - nativeBuildInputs = nativeBuildInputs ++ [ self.qt5.wrapQtAppsHook ]; + nativeBuildInputs = nativeBuildInputs ++ [ self.qt6.wrapQtAppsHook ]; postFixup = postFixup + '' wrapQtApp "$out/lib/rqt_shell/rqt_shell" ''; @@ -350,7 +399,7 @@ let nativeBuildInputs ? [], postFixup ? "", ... }: { dontWrapQtApps = false; - nativeBuildInputs = nativeBuildInputs ++ [ self.qt5.wrapQtAppsHook ]; + nativeBuildInputs = nativeBuildInputs ++ [ self.qt6.wrapQtAppsHook ]; postFixup = postFixup + '' wrapQtApp "$out/lib/rqt_srv/rqt_srv" ''; @@ -360,12 +409,20 @@ let nativeBuildInputs ? [], postFixup ? "", ... }: { dontWrapQtApps = false; - nativeBuildInputs = nativeBuildInputs ++ [ self.qt5.wrapQtAppsHook ]; + nativeBuildInputs = nativeBuildInputs ++ [ self.qt6.wrapQtAppsHook ]; postFixup = postFixup + '' wrapQtApp "$out/lib/rqt_topic/rqt_topic" ''; }); + rviz-imu-plugin = rosSuper.rviz-imu-plugin.overrideAttrs ({ + postPatch ? "", ... + }: { + postPatch = postPatch + '' + substituteInPlace CMakeLists.txt --replace-fail "Qt5" "Qt6" + ''; + }); + # Use rtabmap derivation from nixpkgs, but with the source from ROS. rtabmap = self.rtabmap.overrideAttrs ({ propagatedBuildInputs ? [], ... @@ -388,7 +445,7 @@ let nativeBuildInputs ? [], ... }: { dontWrapQtApps = false; - nativeBuildInputs = nativeBuildInputs ++ [ self.qt5.wrapQtAppsHook ]; + nativeBuildInputs = nativeBuildInputs ++ [ self.qt6.wrapQtAppsHook ]; postFixup = '' wrapQtApp "$out/lib/turtlesim/turtlesim_node" ''; diff --git a/distros/rolling/gz-gui-vendor/vendored-source.json b/distros/rolling/gz-gui-vendor/vendored-source.json index 753d09cd89..fa6a6ddd9a 100644 --- a/distros/rolling/gz-gui-vendor/vendored-source.json +++ b/distros/rolling/gz-gui-vendor/vendored-source.json @@ -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=" } } diff --git a/distros/rolling/gz-launch-vendor/vendored-source.json b/distros/rolling/gz-launch-vendor/vendored-source.json index c1e3727277..de0ed5d36b 100644 --- a/distros/rolling/gz-launch-vendor/vendored-source.json +++ b/distros/rolling/gz-launch-vendor/vendored-source.json @@ -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=" } } diff --git a/distros/rolling/gz-sim-vendor/vendored-source.json b/distros/rolling/gz-sim-vendor/vendored-source.json index 2dc9729305..4b73c02b06 100644 --- a/distros/rolling/gz-sim-vendor/vendored-source.json +++ b/distros/rolling/gz-sim-vendor/vendored-source.json @@ -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=" } } diff --git a/distros/rolling/overrides.nix b/distros/rolling/overrides.nix index 9b72865a6e..16138cf5ed 100644 --- a/distros/rolling/overrides.nix +++ b/distros/rolling/overrides.nix @@ -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({ @@ -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 @@ -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 { }; @@ -120,11 +130,16 @@ 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 ? [], @@ -132,11 +147,9 @@ in { 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 @@ -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 + ]; + }; } diff --git a/distros/ros2-overlay.nix b/distros/ros2-overlay.nix index ca4c417365..3ca7be3365 100644 --- a/distros/ros2-overlay.nix +++ b/distros/ros2-overlay.nix @@ -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 ? [], @@ -342,7 +343,7 @@ rosSelf: rosSuper: with rosSelf.lib; { nativeBuildInputs ? [], qtWrapperArgs ? [], postFixup ? "", meta ? {}, ... }: { dontWrapQtApps = false; - nativeBuildInputs = nativeBuildInputs ++ [ self.qt5.wrapQtAppsHook ]; + nativeBuildInputs = nativeBuildInputs ++ [ self.qt6.wrapQtAppsHook ]; qtWrapperArgs = qtWrapperArgs ++ [ # Use X11 by default in RViz2. # https://github.com/ros-visualization/rviz/issues/1442 diff --git a/flake.nix b/flake.nix index 7c4548e6d5..8f22b3d0dc 100644 --- a/flake.nix +++ b/flake.nix @@ -55,9 +55,4 @@ }; }; - nixConfig = { - extra-substituters = [ "https://ros.cachix.org" ]; - extra-trusted-public-keys = [ "ros.cachix.org-1:dSyZxI8geDCJrwgvCOHDoAfOm5sV1wCPjBkKL+38Rvo=" ]; - }; - } diff --git a/pkgs/ogre/1.9.nix b/pkgs/ogre/1.9.nix index a74f91bd3a..6e09ea9c60 100644 --- a/pkgs/ogre/1.9.nix +++ b/pkgs/ogre/1.9.nix @@ -5,7 +5,6 @@ , libGLU , libGL , freetype -, freeimage , zziplib , xorgproto , libXrandr @@ -62,7 +61,6 @@ stdenv.mkDerivation rec { libGLU libGL freetype - freeimage zziplib xorgproto libXrandr