summary refs log tree commit diff
diff options
context:
space:
mode:
authorWeijia Wang <9713184+wegank@users.noreply.github.com>2023-05-30 11:04:59 +0300
committerWeijia Wang <9713184+wegank@users.noreply.github.com>2023-05-30 11:04:59 +0300
commitb4995a61c7aba0f8718f9d871c24b7a6f5b66466 (patch)
tree208e76084a2e30d8c6e96fe9e17ec2b4c33a9ec9
parent03bec0f29d918ed531522860468cdb5d34256c5b (diff)
downloadnixpkgs-b4995a61c7aba0f8718f9d871c24b7a6f5b66466.tar
nixpkgs-b4995a61c7aba0f8718f9d871c24b7a6f5b66466.tar.gz
nixpkgs-b4995a61c7aba0f8718f9d871c24b7a6f5b66466.tar.bz2
nixpkgs-b4995a61c7aba0f8718f9d871c24b7a6f5b66466.tar.lz
nixpkgs-b4995a61c7aba0f8718f9d871c24b7a6f5b66466.tar.xz
nixpkgs-b4995a61c7aba0f8718f9d871c24b7a6f5b66466.tar.zst
nixpkgs-b4995a61c7aba0f8718f9d871c24b7a6f5b66466.zip
powershell: 7.3.2 -> 7.3.4
-rw-r--r--pkgs/shells/powershell/default.nix22
-rwxr-xr-xpkgs/shells/powershell/getHashes.sh12
2 files changed, 15 insertions, 19 deletions
diff --git a/pkgs/shells/powershell/default.nix b/pkgs/shells/powershell/default.nix
index ec0e3673832..2f7bc15c1b3 100644
--- a/pkgs/shells/powershell/default.nix
+++ b/pkgs/shells/powershell/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, lib, autoPatchelfHook, fetchzip, libunwind, libuuid, icu, curl
+{ stdenv, lib, autoPatchelfHook, fetchurl, libunwind, libuuid, icu, curl
 , darwin, makeWrapper, less, openssl, pam, lttng-ust }:
 
 let archString = if stdenv.isAarch64 then "arm64"
@@ -7,11 +7,12 @@ let archString = if stdenv.isAarch64 then "arm64"
     platformString = if stdenv.isDarwin then "osx"
                      else if stdenv.isLinux then "linux"
                      else throw "unsupported platform";
-    platformSha = if (stdenv.isDarwin && stdenv.isx86_64) then "sha256-JKB7Oy+3KWtVo1Aqmc7vZiO88FrF9+8N/tdGlvIQolM="
-                     else if (stdenv.isDarwin && stdenv.isAarch64) then "sha256-9UwB1tT2VaW+favw/KWPziFMSRWcw7AqeeZvbaGOBqc="
-                     else if (stdenv.isLinux && stdenv.isx86_64) then "sha256-kAcT9av4PFZfYqpS0XwKC0IiquUcVtN30Mq649PUnSM="
-                     else if (stdenv.isLinux && stdenv.isAarch64) then "sha256-3Lm9WYVcfkEVfji/h52VqFy1Jo1AiSQ22JhEGiCPzzM="
-                     else throw "unsupported platform";
+    platformHash = {
+      x86_64-darwin = "sha256-FX3OyVzwU+Ms2tgjpZ4dPdjeJx2H5541dQZAjhI3n1U=";
+      aarch64-darwin = "sha256-Dg7FRF5inRnzP6tjDhIgHTJ1J2EQXnegqimZPK574WQ=";
+      x86_64-linux = "sha256-6F1VROE6kk+LLEpdwtQ6vkbkZjP4no0TjTnAqurLmXY=";
+      aarch64-linux = "sha256-NO4E2TOUIYyUFJmi3zKJzOyP0/rTPTZgJZcebVNkSfk=";
+    }.${stdenv.hostPlatform.system} or (throw "unsupported platform");
     platformLdLibraryPath = if stdenv.isDarwin then "DYLD_FALLBACK_LIBRARY_PATH"
                      else if stdenv.isLinux then "LD_LIBRARY_PATH"
                      else throw "unsupported platform";
@@ -20,14 +21,15 @@ let archString = if stdenv.isAarch64 then "arm64"
 in
 stdenv.mkDerivation rec {
   pname = "powershell";
-  version = "7.3.2";
+  version = "7.3.4";
 
-  src = fetchzip {
+  src = fetchurl {
     url = "https://github.com/PowerShell/PowerShell/releases/download/v${version}/powershell-${version}-${platformString}-${archString}.tar.gz";
-    sha256 = platformSha;
-    stripRoot = false;
+    hash = platformHash;
   };
 
+  sourceRoot = ".";
+
   strictDeps = true;
   buildInputs = [ less ] ++ libraries;
   nativeBuildInputs = [ makeWrapper ]
diff --git a/pkgs/shells/powershell/getHashes.sh b/pkgs/shells/powershell/getHashes.sh
index 727eabb3de8..785ab264ebc 100755
--- a/pkgs/shells/powershell/getHashes.sh
+++ b/pkgs/shells/powershell/getHashes.sh
@@ -1,5 +1,5 @@
 #!/usr/bin/env nix-shell
-#!nix-shell -i bash -p bash wget coreutils gnutar nix
+#!nix-shell -i bash -p bash wget coreutils nix
 version=$1
 
 if [[ -z $version ]]
@@ -11,9 +11,8 @@ fi
 allOutput=""
 
 dlDest=$(mktemp)
-exDest=$(mktemp -d)
 
-trap 'rm $dlDest; rm -r $exDest' EXIT
+trap 'rm $dlDest' EXIT
 
 for plat in osx linux; do
     for arch in x64 arm64; do
@@ -21,18 +20,13 @@ for plat in osx linux; do
         URL="https://github.com/PowerShell/PowerShell/releases/download/v$version/powershell-$version-$plat-$arch.tar.gz"
         wget $URL -O $dlDest >&2
 
-        tar -xzf $dlDest -C $exDest >&2
-
-        hash=$(nix hash path $exDest)
+        hash=$(nix hash file $dlDest)
 
         allOutput+="
 variant: $plat $arch
 hash: $hash
 "
 
-        rm -r $exDest
-        mkdir $exDest
-
     done
 done