diff --git a/distros/iron/overrides.nix b/distros/iron/overrides.nix index 15e116cf58..a89f604723 100644 --- a/distros/iron/overrides.nix +++ b/distros/iron/overrides.nix @@ -1,7 +1,9 @@ # Top level package set self: # Distro package set -rosSelf: rosSuper: with rosSelf.lib; { +rosSelf: rosSuper: let + inherit (rosSelf) lib; +in with lib; { cyclonedds = rosSuper.cyclonedds.overrideAttrs ({ patches ? [], ... }: { @@ -72,10 +74,39 @@ rosSelf: rosSuper: with rosSelf.lib; { }; }; - rviz-ogre-vendor = patchVendorUrl rosSuper.rviz-ogre-vendor { - url = "https://github.com/OGRECave/ogre/archive/v1.12.10.zip"; - sha256 = "sha256-lZDLywgShlWeWah7oTnyKBTqzN505LJKbQbgXRfJXlk="; - }; + rviz-ogre-vendor = rosSuper.rviz-ogre-vendor.overrideAttrs ({ + postPatch ? "", ... + }: let + ogre = self.fetchFromGitHub rec { + name = "${repo}-${rev}"; + owner = "OGRECave"; + repo = "ogre"; + rev = "v1.12.10"; + hash = "sha256-Z0ixdSmkV93coBBVZ5R3lPLfVMXRfWsFz/RsSyqPWFY="; + }; + ogreTar = let + version = "1.79"; + imgui = self.fetchFromGitHub rec { + name = "${repo}-${version}"; + owner = "ocornut"; + repo = "imgui"; + rev = "v${version}"; + hash = "sha256-GIVhZ8Q7WebfHeKeJdVABXrTT26FOS7updncbv2LRnQ="; + }; + imguiTar = lib.tarSource { } imgui; + in lib.tarSource { + hook = '' + substituteInPlace Components/Overlay/CMakeLists.txt \ + --replace ${lib.escapeShellArg imgui.url} file://${lib.escapeShellArg imguiTar} + ''; + } ogre; + in { + postPatch = postPatch + '' + substituteInPlace CMakeLists.txt \ + --replace 'https://github.com/${ogre.owner}/${ogre.repo}/archive/${ogre.rev}.zip' ${lib.escapeShellArg ogreTar} \ + --replace c1b870955efddf539385094e9034e7f7 22a120dfa4d8783b2da24e0dd4a650eb + ''; + }); urdfdom = rosSuper.urdfdom.overrideAttrs ({ patches ? [], ... diff --git a/distros/rolling/overrides.nix b/distros/rolling/overrides.nix index fd99d30d7d..c41d4b40e5 100644 --- a/distros/rolling/overrides.nix +++ b/distros/rolling/overrides.nix @@ -1,7 +1,9 @@ # Top level package set self: # Distro package set -rosSelf: rosSuper: with rosSelf.lib; { +rosSelf: rosSuper: let + inherit (rosSelf) lib; +in with lib; { cyclonedds = rosSuper.cyclonedds.overrideAttrs ({ patches ? [], ... }: { @@ -73,23 +75,23 @@ rosSelf: rosSuper: with rosSelf.lib; { }; }; - rviz-ogre-vendor = patchAmentVendorGit rosSuper.rviz-ogre-vendor { + rviz-ogre-vendor = lib.patchAmentVendorGit rosSuper.rviz-ogre-vendor { url = "https://github.com/OGRECave/ogre.git"; rev = "v1.12.10"; fetchgitArgs.hash = "sha256-Z0ixdSmkV93coBBVZ5R3lPLfVMXRfWsFz/RsSyqPWFY="; tarSourceArgs.hook = let version = "1.79"; - imgui = (self.fetchFromGitHub rec { + imgui = self.fetchFromGitHub rec { name = "${repo}-${version}"; owner = "ocornut"; repo = "imgui"; rev = "v${version}"; hash = "sha256-GIVhZ8Q7WebfHeKeJdVABXrTT26FOS7updncbv2LRnQ="; - }); - imguiTar = tarSource { } imgui; + }; + imguiTar = lib.tarSource { } imgui; in '' substituteInPlace Components/Overlay/CMakeLists.txt \ - --replace ${escapeShellArg imgui.url} file://${escapeShellArg imguiTar} + --replace ${lib.escapeShellArg imgui.url} file://${lib.escapeShellArg imguiTar} ''; };