tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
fetchzip: add pname+version support
Sandro Jäckel
3 years ago
01dfd3cb
7deac8b8
+14
-3
1 changed file
expand all
collapse all
unified
split
pkgs
build-support
fetchzip
default.nix
+14
-3
pkgs/build-support/fetchzip/default.nix
···
14
14
, extraPostFetch ? ""
15
15
, postFetch ? ""
16
16
, name ? "source"
17
17
+
, pname ? ""
18
18
+
, version ? ""
17
19
, nativeBuildInputs ? [ ]
18
20
, # Allows to set the extension for the intermediate downloaded
19
21
# file. This can be used as a hint for the unpackCmdHooks to select
···
23
25
24
26
25
27
lib.warnIf (extraPostFetch != "") "use 'postFetch' instead of 'extraPostFetch' with 'fetchzip' and 'fetchFromGitHub'."
26
26
-
(fetchurl (let
28
28
+
29
29
+
(let
27
30
tmpFilename =
28
31
if extension != null
29
32
then "download.${extension}"
30
33
else baseNameOf (if url != "" then url else builtins.head urls);
31
31
-
in {
32
32
-
inherit name;
34
34
+
in
33
35
36
36
+
fetchurl ((
37
37
+
if (pname != "" && version != "") then
38
38
+
{
39
39
+
name = "${name}-${version}";
40
40
+
inherit pname version;
41
41
+
}
42
42
+
else
43
43
+
{ inherit name; }
44
44
+
) // {
34
45
recursiveHash = true;
35
46
36
47
downloadToTemp = true;