Luke Granger-Brown
57725ef3ec
git-subtree-dir: third_party/nixpkgs git-subtree-split: 76612b17c0ce71689921ca12d9ffdc9c23ce40b2
19 lines
552 B
Nix
19 lines
552 B
Nix
{ lib, fetchpatch }:
|
|
|
|
lib.makeOverridable (
|
|
{ pname, version, debianRevision ? null, area ? "main",
|
|
patch, name ? patch, hash }:
|
|
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}";
|
|
in fetchpatch {
|
|
inherit name hash;
|
|
url =
|
|
"https://sources.debian.org/data/${area}/${prefix}/"
|
|
+ "${pname}/${versionString}/debian/patches/${patch}";
|
|
}
|
|
)
|