@@ -1,11 +1,15 @@
11{ stdenv, lib, autoPatchelfHook, fetchzip, libunwind, libuuid, icu, curl
22, darwin, makeWrapper, less, openssl_1_1, pam, lttng-ust }:
33
4−let platformString = if stdenv.isDarwin then "osx"
4+let archString = if stdenv.isAarch64 then "arm64"
5+ else if stdenv.isx86_64 then "x64"
6+ else throw "unsupported platform";
7+ platformString = if stdenv.isDarwin then "osx"
58 else if stdenv.isLinux then "linux"
69 else throw "unsupported platform";
710 platformSha = if stdenv.isDarwin then "0w44ws8b6zfixf7xz93hmplqsx18279n9x8j77y4rbzs13fldvsn"
8− else if stdenv.isLinux then "0xm7l49zhkz2fly3d751kjd5cy3ws9zji9i0061lkd06dvkch7jy"
11+ else if (stdenv.isLinux && stdenv.isx86_64) then "0xm7l49zhkz2fly3d751kjd5cy3ws9zji9i0061lkd06dvkch7jy"
12+ else if (stdenv.isLinux && stdenv.isAarch64) then "1axbi4kmb1ydys7c45jhp729w1srid3c8jgivb4bdmdp56rf6h32"
913 else throw "unsupported platform";
1014 platformLdLibraryPath = if stdenv.isDarwin then "DYLD_FALLBACK_LIBRARY_PATH"
1115 else if stdenv.isLinux then "LD_LIBRARY_PATH"
@@ -18,7 +22,7 @@ stdenv.mkDerivation rec {
1822 version = "7.1.3";
1923
2024 src = fetchzip {
21− url = "https://github.com/PowerShell/PowerShell/releases/download/v${version}/powershell-${version}-${platformString}-x64.tar.gz";
25+ url = "https://github.com/PowerShell/PowerShell/releases/download/v${version}/powershell-${version}-${platformString}-${archString}.tar.gz";
2226 sha256 = platformSha;
2327 stripRoot = false;
2428 };
@@ -42,7 +46,7 @@ stdenv.mkDerivation rec {
4246 chmod a+x $pslibs/pwsh
4347
4448 ls $pslibs
45− '' + lib.optionalString (!stdenv.isDarwin) ''
49+ '' + lib.optionalString (!stdenv.isDarwin && !stdenv.isAarch64) ''
4650 patchelf --replace-needed libcrypto${ext}.1.0.0 libcrypto${ext}.1.1 $pslibs/libmi.so
4751 patchelf --replace-needed libssl${ext}.1.0.0 libssl${ext}.1.1 $pslibs/libmi.so
4852 '' + ''
@@ -66,7 +70,7 @@ stdenv.mkDerivation rec {
6670 description = "Powerful cross-platform (Windows, Linux, and macOS) shell and scripting language based on .NET";
6771 homepage = "https://github.com/PowerShell/PowerShell";
6872 maintainers = with maintainers; [ yrashk srgom ];
69− platforms = [ "x86_64-darwin" "x86_64-linux" ];
73+ platforms = [ "x86_64-darwin" "x86_64-linux" "aarch64-linux"];
7074 license = with licenses; [ mit ];
7175 };
7276