From c28c56f3790762920f3c9849b05a69fc8b9848f6 Mon Sep 17 00:00:00 2001 From: Weijia Wang <9713184+wegank@users.noreply.github.com> Date: Fri, 12 Jan 2024 20:26:16 +0100 Subject: [PATCH 1/2] fetchzip: allow dropping unzip --- pkgs/build-support/fetchzip/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/build-support/fetchzip/default.nix b/pkgs/build-support/fetchzip/default.nix index 6e6c5270a750..dd04ccb6e093 100644 --- a/pkgs/build-support/fetchzip/default.nix +++ b/pkgs/build-support/fetchzip/default.nix @@ -5,7 +5,7 @@ # (e.g. due to minor changes in the compression algorithm, or changes # in timestamps). -{ lib, fetchurl, unzip, glibcLocalesUtf8 }: +{ lib, fetchurl, withUnzip ? true, unzip, glibcLocalesUtf8 }: { name ? "source" , url ? "" @@ -42,7 +42,7 @@ fetchurl ({ # Have to pull in glibcLocalesUtf8 for unzip in setup-hook.sh to handle # UTF-8 aware locale: # https://github.com/NixOS/nixpkgs/issues/176225#issuecomment-1146617263 - nativeBuildInputs = [ unzip glibcLocalesUtf8 ] ++ nativeBuildInputs; + nativeBuildInputs = lib.optionals withUnzip [ unzip glibcLocalesUtf8 ] ++ nativeBuildInputs; postFetch = '' From 71a024e1f6e0d2263b5249d65b92ef5c14010a79 Mon Sep 17 00:00:00 2001 From: Weijia Wang <9713184+wegank@users.noreply.github.com> Date: Fri, 12 Jan 2024 20:26:20 +0100 Subject: [PATCH 2/2] fetchFromGitHub: drop unzip --- pkgs/build-support/fetchgithub/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/build-support/fetchgithub/default.nix b/pkgs/build-support/fetchgithub/default.nix index a2498700b545..15632d30f744 100644 --- a/pkgs/build-support/fetchgithub/default.nix +++ b/pkgs/build-support/fetchgithub/default.nix @@ -28,7 +28,7 @@ let useFetchGit = fetchSubmodules || (leaveDotGit == true) || deepClone || forceFetchGit || (sparseCheckout != []); # We prefer fetchzip in cases we don't need submodules as the hash # is more stable in that case. - fetcher = if useFetchGit then fetchgit else fetchzip; + fetcher = if useFetchGit then fetchgit else fetchzip.override { withUnzip = false; }; privateAttrs = lib.optionalAttrs private { netrcPhase = '' if [ -z "''$${varBase}USERNAME" -o -z "''$${varBase}PASSWORD" ]; then