nixpkgs/pkgs/build-support/fetchdebianpatch/default.nix
nicoo d4e265327f fetchDebianPatch: Rename patch parameter, make name overrideable
This allows using the fetcher with `invalidateFetcherByDrvHash` for testing.
2023-08-30 07:53:05 +00:00

15 lines
453 B
Nix

{ lib, fetchpatch }:
lib.makeOverridable (
{ pname, version, debianRevision ? null, patch, hash,
area ? "main", name ? "${patch}.patch" }:
let versionString =
if debianRevision == null then version else "${version}-${debianRevision}";
in fetchpatch {
inherit name hash;
url =
"https://sources.debian.org/data/${area}/${builtins.substring 0 1 pname}/"
+ "${pname}/${versionString}/debian/patches/${patch}.patch";
}
)