tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
fetchDebianPatch: Handle the case of `lib*` packages
nicoo
2 years ago
76aedfaa
d613fb52
+16
-3
2 changed files
expand all
collapse all
unified
split
pkgs
build-support
fetchdebianpatch
default.nix
tests.nix
+8
-3
pkgs/build-support/fetchdebianpatch/default.nix
···
3
3
lib.makeOverridable (
4
4
{ pname, version, debianRevision ? null, patch, hash,
5
5
area ? "main", name ? "${patch}.patch" }:
6
6
-
let versionString =
7
7
-
if debianRevision == null then version else "${version}-${debianRevision}";
6
6
+
let
7
7
+
inherit (lib.strings) hasPrefix substring;
8
8
+
prefix =
9
9
+
substring 0 (if hasPrefix "lib" pname then 4 else 1) pname;
10
10
+
versionString =
11
11
+
if debianRevision == null then version
12
12
+
else "${version}-${debianRevision}";
8
13
in fetchpatch {
9
14
inherit name hash;
10
15
url =
11
11
-
"https://sources.debian.org/data/${area}/${builtins.substring 0 1 pname}/"
16
16
+
"https://sources.debian.org/data/${area}/${prefix}/"
12
17
+ "${pname}/${versionString}/debian/patches/${patch}.patch";
13
18
}
14
19
)
+8
pkgs/build-support/fetchdebianpatch/tests.nix
···
8
8
patch = "Add-quotes-to-SOAPAction-header-in-SoapClient";
9
9
hash = "sha256-xA8Wnrpr31H8wy3zHSNfezFNjUJt1HbSXn3qUMzeKc0=";
10
10
};
11
11
+
12
12
+
libPackage = testers.invalidateFetcherByDrvHash fetchDebianPatch {
13
13
+
pname = "libfile-pid-perl";
14
14
+
version = "1.01";
15
15
+
debianRevision = "2";
16
16
+
patch = "missing-pidfile";
17
17
+
hash = "sha256-VBsIYyCnjcZLYQ2Uq2MKPK3kF2wiMKvnq0m727DoavM=";
18
18
+
};
11
19
}