nixpkgs/pkgs/build-support/fetchdebianpatch/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

20 lines
569 B
Nix
Raw Normal View History

2023-08-29 20:09:47 +00:00
{ lib, fetchpatch }:
lib.makeOverridable (
{ pname, version, debianRevision ? null, patch, hash,
area ? "main", name ? "${patch}.patch" }:
let
inherit (lib.strings) hasPrefix substring;
prefix =
substring 0 (if hasPrefix "lib" pname then 4 else 1) pname;
versionString =
if debianRevision == null then version
else "${version}-${debianRevision}";
2023-08-29 20:09:47 +00:00
in fetchpatch {
inherit name hash;
2023-08-29 20:09:47 +00:00
url =
"https://sources.debian.org/data/${area}/${prefix}/"
+ "${pname}/${versionString}/debian/patches/${patch}.patch";
2023-08-29 20:09:47 +00:00
}
)