diff options
author | Vladimír Čunát <v@cunat.cz> | 2024-07-03 19:07:35 +0200 |
---|---|---|
committer | Vladimír Čunát <v@cunat.cz> | 2024-07-03 19:07:35 +0200 |
commit | c76085b3a9d817912d1a00d2d20696e3a8089de3 (patch) | |
tree | 6fdefec11f50e70d351f0ac07001a2c74ae868a1 /pkgs/build-support | |
parent | 1404cb5c7b9a0278f4e24575fda0e1c24e5ed8be (diff) | |
parent | 4974faa55ee9f7b3e651ba755b644091d89ab22e (diff) |
Merge branch 'master' into staging-next
Diffstat (limited to 'pkgs/build-support')
-rw-r--r-- | pkgs/build-support/fetchpatch/default.nix | 12 | ||||
-rw-r--r-- | pkgs/build-support/fetchpatch/tests.nix | 2 |
2 files changed, 8 insertions, 6 deletions
diff --git a/pkgs/build-support/fetchpatch/default.nix b/pkgs/build-support/fetchpatch/default.nix index a3ca6685147d3..97b3661bb2d46 100644 --- a/pkgs/build-support/fetchpatch/default.nix +++ b/pkgs/build-support/fetchpatch/default.nix @@ -14,6 +14,7 @@ , includes ? [] , revert ? false , postFetch ? "" +, nativeBuildInputs ? [] , ... }@args: let @@ -29,6 +30,7 @@ in lib.throwIfNot (excludes == [] || includes == []) "fetchpatch: cannot use excludes and includes simultaneously" fetchurl ({ + nativeBuildInputs = [ patchutils ] ++ nativeBuildInputs; postFetch = '' tmpfile="$TMPDIR/patch" @@ -48,12 +50,12 @@ fetchurl ({ set -e mv "$tmpfile" "$out" - "${patchutils}/bin/lsdiff" \ + lsdiff \ ${lib.optionalString (relative != null) "-p1 -i ${lib.escapeShellArg relative}/'*'"} \ "$out" \ | sort -u | sed -e 's/[*?]/\\&/g' \ | xargs -I{} \ - "${patchutils}/bin/filterdiff" \ + filterdiff \ --include={} \ --strip=${toString stripLen} \ ${lib.optionalString (extraPrefix != null) '' @@ -70,7 +72,7 @@ fetchurl ({ exit 1 fi - ${patchutils}/bin/filterdiff \ + filterdiff \ -p1 \ ${builtins.toString (builtins.map (x: "-x ${lib.escapeShellArg x}") excludes)} \ ${builtins.toString (builtins.map (x: "-i ${lib.escapeShellArg x}") includes)} \ @@ -84,10 +86,10 @@ fetchurl ({ exit 1 fi '' + lib.optionalString revert '' - ${patchutils}/bin/interdiff "$out" /dev/null > "$tmpfile" + interdiff "$out" /dev/null > "$tmpfile" mv "$tmpfile" "$out" '' + postFetch; } // builtins.removeAttrs args [ "relative" "stripLen" "decode" "extraPrefix" "excludes" "includes" "revert" - "postFetch" + "postFetch" "nativeBuildInputs" ]) diff --git a/pkgs/build-support/fetchpatch/tests.nix b/pkgs/build-support/fetchpatch/tests.nix index 0a27f1bc70e7a..b7352fff7f925 100644 --- a/pkgs/build-support/fetchpatch/tests.nix +++ b/pkgs/build-support/fetchpatch/tests.nix @@ -7,7 +7,7 @@ in { simple = testers.invalidateFetcherByDrvHash fetchpatch { url = "https://github.com/facebook/zstd/pull/2724/commits/e1f85dbca3a0ed5ef06c8396912a0914db8dea6a.patch"; - sha256 = if isFetchpatch2 then "sha256-01BrkHLye4KOdqCw3tv7AJzIF6578pl2fl270TJFTmw=" else "sha256-PuYAqnJWAE+L9bsroOnnBGJhERW8LHrGSLtIEkKU9vg="; + sha256 = if isFetchpatch2 then "sha256-w4yU0wt64d0WkuBQPeGf8vn5TH6qSBJvNIgka9QK+/Q=" else "sha256-PuYAqnJWAE+L9bsroOnnBGJhERW8LHrGSLtIEkKU9vg="; }; relative = testers.invalidateFetcherByDrvHash fetchpatch { |