mirror of
https://github.com/lopsided98/nix-ros-overlay.git
synced 2025-06-09 17:42:22 +03:00
patchExternalProjectGit: fail if URL or rev doesn't match
This catches when packages update their vendored version but we haven't updated on our end. Try to fix all usages of patchExternalProjectGit so they are correct now.
This commit is contained in:
parent
c7e6f7c7dd
commit
80b46d5263
8 changed files with 94 additions and 78 deletions
|
@ -134,16 +134,6 @@ let
|
|||
'';
|
||||
});
|
||||
|
||||
novatel-oem7-driver = (patchExternalProjectGit rosSuper.novatel-oem7-driver {
|
||||
url = "https://github.com/novatel/novatel_edie";
|
||||
fetchgitArgs = {
|
||||
rev = "d02ccc2dfe531d642c1e2ca8a8c0f8205c856f23";
|
||||
hash = "sha256-ZQ7z9vQ8quI+SoNhB93tTw5LQe07UAKdbJJpaMj1C6I=";
|
||||
};
|
||||
}).overrideAttrs ({ ... }: {
|
||||
dontFixCmake = true;
|
||||
});
|
||||
|
||||
ompl = rosSuper.ompl.overrideAttrs ({
|
||||
patches ? [], ...
|
||||
}: {
|
||||
|
@ -381,11 +371,6 @@ let
|
|||
'';
|
||||
});
|
||||
|
||||
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;
|
||||
};
|
||||
|
||||
|
|
|
@ -26,10 +26,8 @@ rosSelf: rosSuper: with rosSelf.lib; {
|
|||
|
||||
mcap-vendor = patchExternalProjectGit (patchExternalProjectGit rosSuper.mcap-vendor {
|
||||
url = "https://github.com/foxglove/mcap.git";
|
||||
fetchgitArgs = {
|
||||
rev = "dc6561d9ba867901709e36526dcf7f7359861e9c";
|
||||
hash = "sha256-cWBZgCgxssM3xZZPbZlU1yYlZUD7KJ/wiYSgPXNjwzU=";
|
||||
};
|
||||
rev = "dc6561d9ba867901709e36526dcf7f7359861e9c";
|
||||
fetchgitArgs.hash = "sha256-cWBZgCgxssM3xZZPbZlU1yYlZUD7KJ/wiYSgPXNjwzU=";
|
||||
}) {
|
||||
url = "https://github.com/lz4/lz4.git";
|
||||
fetchgitArgs = {
|
||||
|
|
|
@ -17,14 +17,21 @@ in with lib; {
|
|||
];
|
||||
});
|
||||
|
||||
# This is a newer version than the build system tries to download, but this
|
||||
# version doesn't try to run host platform binaries on the build platform.
|
||||
foonathan-memory-vendor = patchExternalProjectGit rosSuper.foonathan-memory-vendor {
|
||||
url = "https://github.com/foonathan/memory.git";
|
||||
originalRev = "v0.7-1";
|
||||
rev = "v0.7-2";
|
||||
fetchgitArgs.hash = "sha256-5nJNW0xwjSCc0Egq1zv0tIsGvAh1Xbnu8190A1ZP+VA=";
|
||||
};
|
||||
|
||||
gazebo = self.gazebo_11;
|
||||
|
||||
google-benchmark-vendor = lib.patchExternalProjectGit rosSuper.google-benchmark-vendor {
|
||||
url = "https://github.com/google/benchmark.git";
|
||||
fetchgitArgs = {
|
||||
rev = "c05843a9f622db08ad59804c190f98879b76beba";
|
||||
hash = "sha256-h/e2vJacUp7PITez9HPzGc5+ofz7Oplso44VibECmsI=";
|
||||
};
|
||||
rev = "c05843a9f622db08ad59804c190f98879b76beba";
|
||||
fetchgitArgs.hash = "sha256-h/e2vJacUp7PITez9HPzGc5+ofz7Oplso44VibECmsI=";
|
||||
};
|
||||
|
||||
iceoryx-hoofs = rosSuper.iceoryx-hoofs.overrideAttrs ({
|
||||
|
@ -39,6 +46,15 @@ in with lib; {
|
|||
];
|
||||
});
|
||||
|
||||
lely-core-libraries = lib.patchExternalProjectGit rosSuper.lely-core-libraries {
|
||||
url = "https://gitlab.com/lely_industries/lely-core.git";
|
||||
rev = "b63a0b6f79d3ea91dc221724b42dae49894449fc";
|
||||
fetchgitArgs = {
|
||||
hash = "sha256-x9JCU2Ryssq424n90IzVOxixnvsoYTukyCOL3zNbwt4=";
|
||||
leaveDotGit = true;
|
||||
};
|
||||
};
|
||||
|
||||
libphidget22 = patchVendorUrl rosSuper.libphidget22 {
|
||||
url = "https://www.phidgets.com/downloads/phidget22/libraries/linux/libphidget22/libphidget22-1.19.20240304.tar.gz";
|
||||
hash = "sha256-GpzGMpQ02s/X/XEcGoozzMjigrbqvAu81bcb7QG+36E=";
|
||||
|
@ -58,10 +74,8 @@ in with lib; {
|
|||
|
||||
libyaml-vendor = patchExternalProjectGit rosSuper.libyaml-vendor {
|
||||
url = "https://github.com/yaml/libyaml.git";
|
||||
fetchgitArgs = {
|
||||
rev = "2c891fc7a770e8ba2fec34fc6b545c672beb37e6";
|
||||
hash = "sha256-S7PnooyfyAsIiRAlEPGYkgkVACGaBaCItuqOwrq2+qM=";
|
||||
};
|
||||
rev = "2c891fc7a770e8ba2fec34fc6b545c672beb37e6";
|
||||
fetchgitArgs.hash = "sha256-S7PnooyfyAsIiRAlEPGYkgkVACGaBaCItuqOwrq2+qM=";
|
||||
};
|
||||
|
||||
mcap-vendor = patchExternalProjectGit (patchVendorUrl rosSuper.mcap-vendor {
|
||||
|
@ -69,10 +83,8 @@ in with lib; {
|
|||
sha256 = "sha256-KDP3I0QwjqWGOfOzY6DPF2aVgK56tDX0PzsQTP9u9Ug=";
|
||||
}) {
|
||||
url = "https://github.com/lz4/lz4.git";
|
||||
fetchgitArgs = {
|
||||
rev = "d44371841a2f1728a3f36839fd4b7e872d0927d3";
|
||||
hash = "sha256-f7GZgOzUrkAfw1mqwlIKQQqDvkvIahGlHvq6AL+aAvA=";
|
||||
};
|
||||
rev = "d44371841a2f1728a3f36839fd4b7e872d0927d3";
|
||||
fetchgitArgs.hash = "sha256-f7GZgOzUrkAfw1mqwlIKQQqDvkvIahGlHvq6AL+aAvA=";
|
||||
};
|
||||
|
||||
moveit-kinematics = rosSuper.moveit-kinematics.overrideAttrs ({
|
||||
|
@ -83,6 +95,14 @@ in with lib; {
|
|||
propagatedBuildInputs = propagatedBuildInputs ++ [ rosSelf.moveit-ros-planning ];
|
||||
});
|
||||
|
||||
novatel-oem7-driver = (patchExternalProjectGit rosSuper.novatel-oem7-driver {
|
||||
url = "https://github.com/novatel/novatel_edie";
|
||||
rev = "d02ccc2dfe531d642c1e2ca8a8c0f8205c856f23";
|
||||
fetchgitArgs.hash = "sha256-ZQ7z9vQ8quI+SoNhB93tTw5LQe07UAKdbJJpaMj1C6I=";
|
||||
}).overrideAttrs ({ ... }: {
|
||||
dontFixCmake = true;
|
||||
});
|
||||
|
||||
plotjuggler-ros = rosSuper.plotjuggler-ros.overrideAttrs ({
|
||||
patches ? [], nativeBuildInputs ? [], ...
|
||||
}: {
|
||||
|
|
|
@ -17,14 +17,18 @@ in with lib; {
|
|||
];
|
||||
});
|
||||
|
||||
foonathan-memory-vendor = patchExternalProjectGit rosSuper.foonathan-memory-vendor {
|
||||
url = "https://github.com/foonathan/memory.git";
|
||||
rev = "v0.7-3";
|
||||
fetchgitArgs.hash = "sha256-nLBnxPbPKiLCFF2TJgD/eJKJJfzktVBW3SRW2m3WK/s=";
|
||||
};
|
||||
|
||||
gazebo = self.gazebo_11;
|
||||
|
||||
google-benchmark-vendor = lib.patchExternalProjectGit rosSuper.google-benchmark-vendor {
|
||||
url = "https://github.com/google/benchmark.git";
|
||||
fetchgitArgs = {
|
||||
rev = "0d98dba29d66e93259db7daa53a9327df767a415";
|
||||
hash = "sha256-yUiFxi80FWBmTZgqmqTMf9oqcBeg3o4I4vKd4djyRWY=";
|
||||
};
|
||||
rev = "0d98dba29d66e93259db7daa53a9327df767a415";
|
||||
fetchgitArgs.hash = "sha256-yUiFxi80FWBmTZgqmqTMf9oqcBeg3o4I4vKd4djyRWY=";
|
||||
};
|
||||
|
||||
iceoryx-hoofs = rosSuper.iceoryx-hoofs.overrideAttrs ({
|
||||
|
@ -46,10 +50,8 @@ in with lib; {
|
|||
|
||||
libyaml-vendor = patchExternalProjectGit rosSuper.libyaml-vendor {
|
||||
url = "https://github.com/yaml/libyaml.git";
|
||||
fetchgitArgs = {
|
||||
rev = "2c891fc7a770e8ba2fec34fc6b545c672beb37e6";
|
||||
hash = "sha256-S7PnooyfyAsIiRAlEPGYkgkVACGaBaCItuqOwrq2+qM=";
|
||||
};
|
||||
rev = "2c891fc7a770e8ba2fec34fc6b545c672beb37e6";
|
||||
fetchgitArgs.hash = "sha256-S7PnooyfyAsIiRAlEPGYkgkVACGaBaCItuqOwrq2+qM=";
|
||||
};
|
||||
|
||||
mcap-vendor = patchExternalProjectGit (patchVendorUrl rosSuper.mcap-vendor {
|
||||
|
@ -57,10 +59,8 @@ in with lib; {
|
|||
sha256 = "sha256-KDP3I0QwjqWGOfOzY6DPF2aVgK56tDX0PzsQTP9u9Ug=";
|
||||
}) {
|
||||
url = "https://github.com/lz4/lz4.git";
|
||||
fetchgitArgs = {
|
||||
rev = "d44371841a2f1728a3f36839fd4b7e872d0927d3";
|
||||
hash = "sha256-f7GZgOzUrkAfw1mqwlIKQQqDvkvIahGlHvq6AL+aAvA=";
|
||||
};
|
||||
rev = "d44371841a2f1728a3f36839fd4b7e872d0927d3";
|
||||
fetchgitArgs.hash = "sha256-f7GZgOzUrkAfw1mqwlIKQQqDvkvIahGlHvq6AL+aAvA=";
|
||||
};
|
||||
|
||||
rviz-ogre-vendor = rosSuper.rviz-ogre-vendor.overrideAttrs ({
|
||||
|
|
|
@ -17,14 +17,18 @@ in {
|
|||
];
|
||||
});
|
||||
|
||||
foonathan-memory-vendor = lib.patchExternalProjectGit rosSuper.foonathan-memory-vendor {
|
||||
url = "https://github.com/foonathan/memory.git";
|
||||
rev = "v0.7-3";
|
||||
fetchgitArgs.hash = "sha256-nLBnxPbPKiLCFF2TJgD/eJKJJfzktVBW3SRW2m3WK/s=";
|
||||
};
|
||||
|
||||
gazebo = self.gazebo_11;
|
||||
|
||||
google-benchmark-vendor = lib.patchExternalProjectGit rosSuper.google-benchmark-vendor {
|
||||
url = "https://github.com/google/benchmark.git";
|
||||
fetchgitArgs = {
|
||||
rev = "344117638c8ff7e239044fd0fa7085839fc03021";
|
||||
hash = "sha256-gztnxui9Fe/FTieMjdvfJjWHjkImtlsHn6fM1FruyME=";
|
||||
};
|
||||
rev = "344117638c8ff7e239044fd0fa7085839fc03021";
|
||||
fetchgitArgs.hash = "sha256-gztnxui9Fe/FTieMjdvfJjWHjkImtlsHn6fM1FruyME=";
|
||||
};
|
||||
|
||||
iceoryx-hoofs = rosSuper.iceoryx-hoofs.overrideAttrs ({
|
||||
|
@ -41,9 +45,9 @@ in {
|
|||
|
||||
lely-core-libraries = lib.patchExternalProjectGit rosSuper.lely-core-libraries {
|
||||
url = "https://gitlab.com/lely_industries/lely-core.git";
|
||||
rev = "b63a0b6f79d3ea91dc221724b42dae49894449fc";
|
||||
fetchgitArgs = {
|
||||
rev = "7824cbb2ac08d091c4fa2fb397669b938de9e3f5";
|
||||
sha256 = "sha256-Ykmnz/zlEXmkyRO9AHMprML7uKbNer2zu4i9PDHfgxw=";
|
||||
hash = "sha256-x9JCU2Ryssq424n90IzVOxixnvsoYTukyCOL3zNbwt4=";
|
||||
leaveDotGit = true;
|
||||
};
|
||||
};
|
||||
|
|
|
@ -17,14 +17,18 @@ in {
|
|||
];
|
||||
});
|
||||
|
||||
foonathan-memory-vendor = lib.patchExternalProjectGit rosSuper.foonathan-memory-vendor {
|
||||
url = "https://github.com/foonathan/memory.git";
|
||||
rev = "v0.7-3";
|
||||
fetchgitArgs.hash = "sha256-nLBnxPbPKiLCFF2TJgD/eJKJJfzktVBW3SRW2m3WK/s=";
|
||||
};
|
||||
|
||||
gazebo = self.gazebo_11;
|
||||
|
||||
google-benchmark-vendor = lib.patchExternalProjectGit rosSuper.google-benchmark-vendor {
|
||||
url = "https://github.com/google/benchmark.git";
|
||||
fetchgitArgs = {
|
||||
rev = "344117638c8ff7e239044fd0fa7085839fc03021";
|
||||
hash = "sha256-gztnxui9Fe/FTieMjdvfJjWHjkImtlsHn6fM1FruyME=";
|
||||
};
|
||||
rev = "344117638c8ff7e239044fd0fa7085839fc03021";
|
||||
fetchgitArgs.hash = "sha256-gztnxui9Fe/FTieMjdvfJjWHjkImtlsHn6fM1FruyME=";
|
||||
};
|
||||
|
||||
iceoryx-hoofs = rosSuper.iceoryx-hoofs.overrideAttrs ({
|
||||
|
@ -41,9 +45,9 @@ in {
|
|||
|
||||
lely-core-libraries = lib.patchExternalProjectGit rosSuper.lely-core-libraries {
|
||||
url = "https://gitlab.com/lely_industries/lely-core.git";
|
||||
rev = "b63a0b6f79d3ea91dc221724b42dae49894449fc";
|
||||
fetchgitArgs = {
|
||||
rev = "7824cbb2ac08d091c4fa2fb397669b938de9e3f5";
|
||||
sha256 = "sha256-Ykmnz/zlEXmkyRO9AHMprML7uKbNer2zu4i9PDHfgxw=";
|
||||
hash = "sha256-x9JCU2Ryssq424n90IzVOxixnvsoYTukyCOL3zNbwt4=";
|
||||
leaveDotGit = true;
|
||||
};
|
||||
};
|
||||
|
@ -54,8 +58,8 @@ in {
|
|||
};
|
||||
|
||||
mcap-vendor = lib.patchVendorUrl rosSuper.mcap-vendor {
|
||||
url = "https://github.com/foxglove/mcap/archive/refs/tags/releases/cpp/v1.3.0.tar.gz";
|
||||
hash = "sha256-Qaz26F11VWxkQH8HfgVJLTHbHwmeByQu8ENkuyk5rPE=";
|
||||
url = "https://github.com/foxglove/mcap/archive/refs/tags/releases/cpp/v1.1.0.tar.gz";
|
||||
hash = "sha256-HLKuny6RDusuk7OrcidE0YBbnaRXZOT9iHA7ZpQTNQ0=";
|
||||
};
|
||||
|
||||
rviz-ogre-vendor = lib.patchAmentVendorGit rosSuper.rviz-ogre-vendor {
|
||||
|
|
|
@ -35,20 +35,10 @@ rosSelf: rosSuper: with rosSelf.lib; {
|
|||
|
||||
fmilibrary-vendor = patchExternalProjectGit rosSuper.fmilibrary-vendor {
|
||||
url = "https://github.com/modelon-community/fmi-library.git";
|
||||
fetchgitArgs = {
|
||||
rev = "2.1";
|
||||
sha256 = "177rlw1ba1y0ahi8qfpg0sflh8mjdl6fmffwjg2a5vxyxwdwrjvh";
|
||||
};
|
||||
};
|
||||
|
||||
# This is a newer version than the build system tries to download, but this
|
||||
# version doesn't try to run host platform binaries on the build platform.
|
||||
foonathan-memory-vendor = patchExternalProjectGit rosSuper.foonathan-memory-vendor {
|
||||
url = "https://github.com/foonathan/memory.git";
|
||||
fetchgitArgs = {
|
||||
rev = "v0.7-2";
|
||||
sha256 = "sha256-5nJNW0xwjSCc0Egq1zv0tIsGvAh1Xbnu8190A1ZP+VA=";
|
||||
};
|
||||
# Uses ${fmilibrary_version}, so can't match
|
||||
originalRev = "";
|
||||
rev = "2.2.3";
|
||||
fetchgitArgs.hash = "sha256-i8EtjPMg39S/3RyoUaXm5A8Nu/NbgAwjxRCdyh2elyU=";
|
||||
};
|
||||
|
||||
gmock-vendor = rosSuper.gmock-vendor.overrideAttrs ({
|
||||
|
@ -117,10 +107,8 @@ rosSelf: rosSuper: with rosSelf.lib; {
|
|||
|
||||
rig-reconfigure = patchExternalProjectGit rosSuper.rig-reconfigure {
|
||||
url = "https://github.com/ocornut/imgui.git";
|
||||
fetchgitArgs = {
|
||||
rev = "3ea0fad204e994d669f79ed29dcaf61cd5cb571d";
|
||||
sha256 = "sha256-v9FP9zJvul+2zRGaIugNDBCR9xZqCY8U90Dfe6fXpJM=";
|
||||
};
|
||||
rev = "v1.89.8-docking";
|
||||
fetchgitArgs.hash = "sha256-eY8lRsonPfDRTMCPhInT9rQ6lSaJPsXpkh428OKpTnA=";
|
||||
};
|
||||
|
||||
rmw-implementation = rosSuper.rmw-implementation.overrideAttrs ({
|
||||
|
|
|
@ -45,15 +45,32 @@
|
|||
|
||||
patchExternalProjectGit = pkg: {
|
||||
url,
|
||||
rev,
|
||||
originalRev ? rev,
|
||||
originalUrl ? url,
|
||||
file ? "CMakeLists.txt",
|
||||
fetchgitArgs ? {}
|
||||
}: pkg.overrideAttrs ({
|
||||
postPatch ? "", ...
|
||||
}: {
|
||||
postPatch = ''
|
||||
sed -i '\|GIT_REPOSITORY\s.*${originalUrl}|c\
|
||||
URL "${self.fetchgit ({ inherit url; } // fetchgitArgs)}"' \
|
||||
postPatch = let
|
||||
script = ''
|
||||
$0 ~ "GIT_REPOSITORY[[:blank:]]+" originalUrl \
|
||||
{ print "URL \"" path "\""; foundUrl=1; next } \
|
||||
{ print }
|
||||
$0 ~ "GIT_TAG[[:blank:]]+" originalRev { print; foundRev=1 }
|
||||
END {
|
||||
if (!foundUrl) print "patchExternalProjectGit: did not find URL: " originalUrl > "/dev/stderr"
|
||||
if (!foundRev) print "patchExternalProjectGit: did not find revision: " originalRev > "/dev/stderr"
|
||||
exit !(foundUrl && foundRev)
|
||||
}
|
||||
'';
|
||||
in ''
|
||||
awk -i inplace \
|
||||
-v originalUrl=${lib.escapeShellArg originalUrl} \
|
||||
-v originalRev=${lib.escapeShellArg originalRev} \
|
||||
-v path=${lib.escapeShellArg (self.fetchgit ({ inherit url rev; } // fetchgitArgs))} \
|
||||
${lib.escapeShellArg script} \
|
||||
${lib.escapeShellArg file}
|
||||
'' + postPatch;
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue