summary refs log tree commit diff
diff options
context:
space:
mode:
authorJonathan Ringer <jonringer117@gmail.com>2022-02-09 16:43:37 -0800
committerJonathan Ringer <jonringer@users.noreply.github.com>2022-02-26 08:58:08 -0800
commit24cbda98f321bad884e3e464ec0ef965d4a91777 (patch)
tree7001f4282adb842da8b35a631e6efd077703f2c5
parentb97b9c376c093ca3a582a4477e6e61a40a9fc6d5 (diff)
downloadnixpkgs-24cbda98f321bad884e3e464ec0ef965d4a91777.tar
nixpkgs-24cbda98f321bad884e3e464ec0ef965d4a91777.tar.gz
nixpkgs-24cbda98f321bad884e3e464ec0ef965d4a91777.tar.bz2
nixpkgs-24cbda98f321bad884e3e464ec0ef965d4a91777.tar.lz
nixpkgs-24cbda98f321bad884e3e464ec0ef965d4a91777.tar.xz
nixpkgs-24cbda98f321bad884e3e464ec0ef965d4a91777.tar.zst
nixpkgs-24cbda98f321bad884e3e464ec0ef965d4a91777.zip
fetchzip: remove need for overrideAttrs
-rw-r--r--pkgs/build-support/fetchurl/default.nix5
-rw-r--r--pkgs/build-support/fetchzip/default.nix8
2 files changed, 8 insertions, 5 deletions
diff --git a/pkgs/build-support/fetchurl/default.nix b/pkgs/build-support/fetchurl/default.nix
index 72af03e03d9..776089dab99 100644
--- a/pkgs/build-support/fetchurl/default.nix
+++ b/pkgs/build-support/fetchurl/default.nix
@@ -95,6 +95,9 @@ in
   # Doing the download on a remote machine just duplicates network
   # traffic, so don't do that by default
 , preferLocalBuild ? true
+
+  # Additional packages needed as part of a fetch
+, nativeBuildInputs ? [ ]
 }:
 
 assert sha512 != "" -> builtins.compareVersions "1.11" builtins.nixVersion <= 0;
@@ -128,7 +131,7 @@ stdenvNoCC.mkDerivation {
 
   builder = ./builder.sh;
 
-  nativeBuildInputs = [ curl ];
+  nativeBuildInputs = [ curl ] ++ nativeBuildInputs;
 
   urls = urls_;
 
diff --git a/pkgs/build-support/fetchzip/default.nix b/pkgs/build-support/fetchzip/default.nix
index af38537737e..a3f22de58c7 100644
--- a/pkgs/build-support/fetchzip/default.nix
+++ b/pkgs/build-support/fetchzip/default.nix
@@ -13,6 +13,7 @@
 , urls ? []
 , extraPostFetch ? ""
 , name ? "source"
+, nativeBuildInputs ? [ ]
 , # Allows to set the extension for the intermediate downloaded
   # file. This can be used as a hint for the unpackCmdHooks to select
   # an appropriate unpacking tool.
@@ -31,6 +32,8 @@ in {
 
   downloadToTemp = true;
 
+  nativeBuildInputs = [ unzip ] ++ nativeBuildInputs;
+
   postFetch =
     ''
       unpackDir="$TMPDIR/unpack"
@@ -64,7 +67,4 @@ in {
     + ''
       chmod 755 "$out"
     '';
-} // removeAttrs args [ "stripRoot" "extraPostFetch" "extension" ])).overrideAttrs (x: {
-  # Hackety-hack: we actually need unzip hooks, too
-  nativeBuildInputs = x.nativeBuildInputs ++ [ unzip ];
-})
+} // removeAttrs args [ "stripRoot" "extraPostFetch" "extension" "nativeBuildInputs" ]))