about summary refs log tree commit diff
path: root/pkgs/build-support
diff options
context:
space:
mode:
authorStig <stig@stig.io>2022-08-24 17:28:04 +0200
committerGitHub <noreply@github.com>2022-08-24 17:28:04 +0200
commit24f160cfcde277bcc61abe8a5f89f1e807bdc67f (patch)
treee5421f71a8cc4366068a793f2217c28d7e63d034 /pkgs/build-support
parentf012739348de43b8ef8c2b356165ca360839438b (diff)
parent071d09de304d31d75d870892bd455668dac3f0a1 (diff)
Merge pull request #187884 from helsinki-systems/feat/perl-sri
perlPackages: Switch to SRI hashes, add `hash` support to bootstrap fetchurl, bump minimal nix version
Diffstat (limited to 'pkgs/build-support')
-rw-r--r--pkgs/build-support/fetchurl/boot.nix9
1 files changed, 7 insertions, 2 deletions
diff --git a/pkgs/build-support/fetchurl/boot.nix b/pkgs/build-support/fetchurl/boot.nix
index bd71f93c52919..8f8c78b7a454a 100644
--- a/pkgs/build-support/fetchurl/boot.nix
+++ b/pkgs/build-support/fetchurl/boot.nix
@@ -4,12 +4,17 @@ let mirrors = import ./mirrors.nix; in
 
 { url ? builtins.head urls
 , urls ? []
-, sha256
+, sha256 ? ""
+, hash ? ""
 , name ? baseNameOf (toString url)
 }:
 
+# assert exactly one hash is set
+assert hash != "" || sha256 != "";
+assert hash != "" -> sha256 == "";
+
 import <nix/fetchurl.nix> {
-  inherit system sha256 name;
+  inherit system hash sha256 name;
 
   url =
     # Handle mirror:// URIs. Since <nix/fetchurl.nix> currently