about summary refs log tree commit diff
path: root/pkgs/build-support/trivial-builders
diff options
context:
space:
mode:
authorAndrew Marshall <andrew@johnandrewmarshall.com>2023-06-01 13:48:58 -0400
committerAndrew Marshall <andrew@johnandrewmarshall.com>2024-01-12 15:49:24 -0500
commit52c27352ce96097741420918d5f19573b29d168f (patch)
tree90ba99defe2db960a902a376391bc4af5b011821 /pkgs/build-support/trivial-builders
parent317484b1ead87b9c1b8ac5261a8d2dd748a0492d (diff)
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.
Diffstat (limited to 'pkgs/build-support/trivial-builders')
-rw-r--r--pkgs/build-support/trivial-builders/default.nix5
1 files changed, 4 insertions, 1 deletions
diff --git a/pkgs/build-support/trivial-builders/default.nix b/pkgs/build-support/trivial-builders/default.nix
index bdb79d9bf463c..07447b6461bc2 100644
--- a/pkgs/build-support/trivial-builders/default.nix
+++ b/pkgs/build-support/trivial-builders/default.nix
@@ -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;