From 9555fd73f323deb21d25a4a045ba67ad2f87d2c6 Mon Sep 17 00:00:00 2001 From: Bob van der Linden Date: Sat, 13 Apr 2019 23:12:55 +0200 Subject: fetchpatch: explicitly use patchutils 0.3.3 --- pkgs/build-support/fetchpatch/default.nix | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'pkgs/build-support') diff --git a/pkgs/build-support/fetchpatch/default.nix b/pkgs/build-support/fetchpatch/default.nix index 89d72f512f7f..b5bbed284506 100644 --- a/pkgs/build-support/fetchpatch/default.nix +++ b/pkgs/build-support/fetchpatch/default.nix @@ -5,6 +5,9 @@ # stripLen acts as the -p parameter when applying a patch. { lib, fetchurl, buildPackages }: +let + patchutils = buildPackages.patchutils_0_3_3; +in { stripLen ? 0, extraPrefix ? null, excludes ? [], includes ? [], revert ? false, ... }@args: fetchurl ({ @@ -14,10 +17,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 +35,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 +49,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 != []; -- cgit 1.4.1 From e07c5ec107c720b9f1ace4bfa87fe8f359e358c0 Mon Sep 17 00:00:00 2001 From: Vladimír Čunát Date: Sun, 12 May 2019 15:16:45 +0200 Subject: fetchpatch: explain why we use 0.3.3 --- pkgs/build-support/fetchpatch/default.nix | 1 + 1 file changed, 1 insertion(+) (limited to 'pkgs/build-support') diff --git a/pkgs/build-support/fetchpatch/default.nix b/pkgs/build-support/fetchpatch/default.nix index b5bbed284506..2fb32b2324f2 100644 --- a/pkgs/build-support/fetchpatch/default.nix +++ b/pkgs/build-support/fetchpatch/default.nix @@ -6,6 +6,7 @@ { 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: -- cgit 1.4.1