about summary refs log tree commit diff
path: root/nixpkgs/pkgs/build-support/fetchpatch
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2019-05-17 10:56:54 +0000
committerAlyssa Ross <hi@alyssa.is>2019-05-17 10:56:54 +0000
commitc1d22074139ab0d048a05b5e5116265d099114d6 (patch)
tree97977009422d675f8930f97c309b010481289e72 /nixpkgs/pkgs/build-support/fetchpatch
parent4dc8afe4fd6b18437150129e0a1ecc23c6a1c0b9 (diff)
parentbc9df0f66110039e495b6debe3a6cda4a1bb0fed (diff)
downloadnixlib-c1d22074139ab0d048a05b5e5116265d099114d6.tar
nixlib-c1d22074139ab0d048a05b5e5116265d099114d6.tar.gz
nixlib-c1d22074139ab0d048a05b5e5116265d099114d6.tar.bz2
nixlib-c1d22074139ab0d048a05b5e5116265d099114d6.tar.lz
nixlib-c1d22074139ab0d048a05b5e5116265d099114d6.tar.xz
nixlib-c1d22074139ab0d048a05b5e5116265d099114d6.tar.zst
nixlib-c1d22074139ab0d048a05b5e5116265d099114d6.zip
Merge commit 'bc9df0f66110039e495b6debe3a6cda4a1bb0fed'
Diffstat (limited to 'nixpkgs/pkgs/build-support/fetchpatch')
-rw-r--r--nixpkgs/pkgs/build-support/fetchpatch/default.nix12
1 files changed, 8 insertions, 4 deletions
diff --git a/nixpkgs/pkgs/build-support/fetchpatch/default.nix b/nixpkgs/pkgs/build-support/fetchpatch/default.nix
index 89d72f512f7f..2fb32b2324f2 100644
--- a/nixpkgs/pkgs/build-support/fetchpatch/default.nix
+++ b/nixpkgs/pkgs/build-support/fetchpatch/default.nix
@@ -5,6 +5,10 @@
 # stripLen acts as the -p parameter when applying a patch.
 
 { lib, fetchurl, buildPackages }:
+let
+  # 0.3.4 would change hashes: https://github.com/NixOS/nixpkgs/issues/25154
+  patchutils = buildPackages.patchutils_0_3_3;
+in
 { stripLen ? 0, extraPrefix ? null, excludes ? [], includes ? [], revert ? false, ... }@args:
 
 fetchurl ({
@@ -14,10 +18,10 @@ fetchurl ({
       echo "error: Fetched patch file '$out' is empty!" 1>&2
       exit 1
     fi
-    "${buildPackages.patchutils}/bin/lsdiff" "$out" \
+    "${patchutils}/bin/lsdiff" "$out" \
       | sort -u | sed -e 's/[*?]/\\&/g' \
       | xargs -I{} \
-        "${buildPackages.patchutils}/bin/filterdiff" \
+        "${patchutils}/bin/filterdiff" \
         --include={} \
         --strip=${toString stripLen} \
         ${lib.optionalString (extraPrefix != null) ''
@@ -32,7 +36,7 @@ fetchurl ({
       cat "$out" 1>&2
       exit 1
     fi
-    ${buildPackages.patchutils}/bin/filterdiff \
+    ${patchutils}/bin/filterdiff \
       -p1 \
       ${builtins.toString (builtins.map (x: "-x ${lib.escapeShellArg x}") excludes)} \
       ${builtins.toString (builtins.map (x: "-i ${lib.escapeShellArg x}") includes)} \
@@ -46,7 +50,7 @@ fetchurl ({
       exit 1
     fi
   '' + lib.optionalString revert ''
-    ${buildPackages.patchutils}/bin/interdiff "$out" /dev/null > "$tmpfile"
+    ${patchutils}/bin/interdiff "$out" /dev/null > "$tmpfile"
     mv "$tmpfile" "$out"
   '' + (args.postFetch or "");
   meta.broken = excludes != [] && includes != [];