Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)

fetchpatch2: init

allows us to use the new features of patchutils without having to reset
all fetchpatch hashes in nixpkgs

https://github.com/NixOS/nixpkgs/issues/32084
(cherry picked from commit 41877098f3ac00295a2a9d5e5846201b969a689b)

authored by

Artturin and committed by
github-actions[bot]
ee5ee119 73deccfe

+24 -12
+2 -5
pkgs/build-support/fetchpatch/default.nix
··· 4 4 # often change with updating of git or cgit. 5 5 # stripLen acts as the -p parameter when applying a patch. 6 6 7 - { lib, fetchurl, buildPackages }: 8 - let 9 - # 0.3.4 would change hashes: https://github.com/NixOS/nixpkgs/issues/25154 10 - patchutils = buildPackages.patchutils_0_3_3; 11 - in 7 + { lib, fetchurl, patchutils }: 8 + 12 9 { relative ? null 13 10 , stripLen ? 0 14 11 , extraPrefix ? null
+7 -3
pkgs/build-support/fetchpatch/tests.nix
··· 1 1 { testers, fetchpatch, ... }: 2 2 3 + let 4 + isFetchpatch2 = fetchpatch.version == 2; 5 + in 6 + 3 7 { 4 8 simple = testers.invalidateFetcherByDrvHash fetchpatch { 5 9 url = "https://github.com/facebook/zstd/pull/2724/commits/e1f85dbca3a0ed5ef06c8396912a0914db8dea6a.patch"; 6 - sha256 = "sha256-PuYAqnJWAE+L9bsroOnnBGJhERW8LHrGSLtIEkKU9vg="; 10 + sha256 = if isFetchpatch2 then "sha256-01BrkHLye4KOdqCw3tv7AJzIF6578pl2fl270TJFTmw=" else "sha256-PuYAqnJWAE+L9bsroOnnBGJhERW8LHrGSLtIEkKU9vg="; 7 11 }; 8 12 9 13 relative = testers.invalidateFetcherByDrvHash fetchpatch { 10 14 url = "https://github.com/boostorg/math/commit/7d482f6ebc356e6ec455ccb5f51a23971bf6ce5b.patch"; 11 15 relative = "include"; 12 - sha256 = "sha256-KlmIbixcds6GyKYt1fx5BxDIrU7msrgDdYo9Va/KJR4="; 16 + sha256 = if isFetchpatch2 then "sha256-1TtmuKeNIl/Yp+sfzBMR8Ue78tPIgjqGgjasa5IN52o=" else "sha256-KlmIbixcds6GyKYt1fx5BxDIrU7msrgDdYo9Va/KJR4="; 13 17 }; 14 18 15 19 full = testers.invalidateFetcherByDrvHash fetchpatch { ··· 19 23 extraPrefix = "foo/bar/"; 20 24 excludes = [ "foo/bar/bernoulli_no_atomic_mp.cpp" ]; 21 25 revert = true; 22 - sha256 = "sha256-+UKmEbr2rIAweCav/hR/7d4ZrYV84ht/domTrHtm8sM="; 26 + sha256 = if isFetchpatch2 then "sha256-+UKmEbr2rIAweCav/hR/7d4ZrYV84ht/domTrHtm8sM=" else "sha256-+UKmEbr2rIAweCav/hR/7d4ZrYV84ht/domTrHtm8sM="; 23 27 }; 24 28 }
+1
pkgs/test/default.nix
··· 31 31 32 32 fetchurl = callPackages ../build-support/fetchurl/tests.nix { }; 33 33 fetchpatch = callPackages ../build-support/fetchpatch/tests.nix { }; 34 + fetchpatch2 = callPackages ../build-support/fetchpatch/tests.nix { fetchpatch = fetchpatch2; }; 34 35 fetchzip = callPackages ../build-support/fetchzip/tests.nix { }; 35 36 fetchgit = callPackages ../build-support/fetchgit/tests.nix { }; 36 37 fetchFirefoxAddon = callPackages ../build-support/fetchfirefoxaddon/tests.nix { };
+14 -4
pkgs/top-level/all-packages.nix
··· 801 801 802 802 broadlink-cli = callPackage ../tools/misc/broadlink-cli {}; 803 803 804 - fetchpatch = callPackage ../build-support/fetchpatch { } 805 - // { 806 - tests = pkgs.tests.fetchpatch; 807 - }; 804 + fetchpatch = callPackage ../build-support/fetchpatch { 805 + # 0.3.4 would change hashes: https://github.com/NixOS/nixpkgs/issues/25154 806 + patchutils = buildPackages.patchutils_0_3_3; 807 + } // { 808 + tests = pkgs.tests.fetchpatch; 809 + version = 1; 810 + }; 811 + 812 + fetchpatch2 = callPackage ../build-support/fetchpatch { 813 + patchutils = buildPackages.patchutils_0_4_2; 814 + } // { 815 + tests = pkgs.tests.fetchpatch2; 816 + version = 2; 817 + }; 808 818 809 819 fetchs3 = callPackage ../build-support/fetchs3 { }; 810 820