tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
fetchfossil: support SRI hashes
Francesco Gazzetta
2 years ago
c034d14c
34847de9
+16
-3
1 changed file
expand all
collapse all
unified
split
pkgs
build-support
fetchfossil
default.nix
+16
-3
pkgs/build-support/fetchfossil/default.nix
···
1
1
{stdenv, lib, fossil, cacert}:
2
2
3
3
-
{name ? null, url, rev, sha256}:
3
3
+
{ name ? null
4
4
+
, url
5
5
+
, rev
6
6
+
, sha256 ? ""
7
7
+
, hash ? ""
8
8
+
}:
4
9
10
10
+
if hash != "" && sha256 != "" then
11
11
+
throw "Only one of sha256 or hash can be set"
12
12
+
else
5
13
stdenv.mkDerivation {
6
14
name = "fossil-archive" + (lib.optionalString (name != null) "-${name}");
7
15
builder = ./builder.sh;
···
11
19
# https://www.fossil-scm.org/index.html/doc/trunk/www/env-opts.md
12
20
impureEnvVars = [ "http_proxy" ];
13
21
14
14
-
outputHashAlgo = "sha256";
22
22
+
outputHashAlgo = if hash != "" then null else "sha256";
15
23
outputHashMode = "recursive";
16
16
-
outputHash = sha256;
24
24
+
outputHash = if hash != "" then
25
25
+
hash
26
26
+
else if sha256 != "" then
27
27
+
sha256
28
28
+
else
29
29
+
lib.fakeSha256;
17
30
18
31
inherit url rev;
19
32
preferLocalBuild = true;