nixpkgs: don't fail build if a patch has already been applied

This commit is contained in:
Colin 2024-06-08 22:49:55 +00:00
parent b6d9d58a14
commit 75ae868bde

View File

@ -51,6 +51,13 @@ let
inherit variant; inherit variant;
date = unpatchedSrc.lastModifiedDate; date = unpatchedSrc.lastModifiedDate;
}; };
# skip applied patches
prePatch = ''
realpatch=$(command -v patch)
patch() {
OUT=$($realpatch "$@") || echo "$OUT" | grep "Skipping patch" -q
}
'';
}; };
src = if doPatch then patchedSrc else { outPath = unpatchedSrc; }; src = if doPatch then patchedSrc else { outPath = unpatchedSrc; };