fetchDebianPatch: Handle the case of lib* packages

This commit is contained in:
nicoo 2023-08-30 08:26:52 +00:00
parent d613fb52c9
commit 76aedfaaee
2 changed files with 16 additions and 3 deletions

View File

@ -3,12 +3,17 @@
lib.makeOverridable (
{ pname, version, debianRevision ? null, patch, hash,
area ? "main", name ? "${patch}.patch" }:
let versionString =
if debianRevision == null then version else "${version}-${debianRevision}";
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}/${builtins.substring 0 1 pname}/"
"https://sources.debian.org/data/${area}/${prefix}/"
+ "${pname}/${versionString}/debian/patches/${patch}.patch";
}
)

View File

@ -8,4 +8,12 @@
patch = "Add-quotes-to-SOAPAction-header-in-SoapClient";
hash = "sha256-xA8Wnrpr31H8wy3zHSNfezFNjUJt1HbSXn3qUMzeKc0=";
};
libPackage = testers.invalidateFetcherByDrvHash fetchDebianPatch {
pname = "libfile-pid-perl";
version = "1.01";
debianRevision = "2";
patch = "missing-pidfile";
hash = "sha256-VBsIYyCnjcZLYQ2Uq2MKPK3kF2wiMKvnq0m727DoavM=";
};
}