applyPatches: skip creating additional drv when no patches

If there are no `patches` or `postPatch`, then this will just do work to
make something equivalent to `src`. Instead, just return `src` in that
case.
This commit is contained in:
Andrew Marshall 2023-06-01 13:48:58 -04:00
parent 317484b1ea
commit 52c27352ce

View file

@ -946,7 +946,10 @@ rec {
, patches ? [ ]
, postPatch ? ""
, ...
}@args: stdenvNoCC.mkDerivation
}@args:
if patches == [ ] && postPatch == ""
then src # nothing to do, so use original src to avoid additional drv
else stdenvNoCC.mkDerivation
{
inherit name src patches postPatch;
preferLocalBuild = true;