powershell: add aarch64 support for Linux
This commit is contained in:
parent
2e3e591211
commit
3cbcbfc4fc
|
@ -1,11 +1,15 @@
|
||||||
{ stdenv, lib, autoPatchelfHook, fetchzip, libunwind, libuuid, icu, curl
|
{ stdenv, lib, autoPatchelfHook, fetchzip, libunwind, libuuid, icu, curl
|
||||||
, darwin, makeWrapper, less, openssl_1_1, pam, lttng-ust }:
|
, darwin, makeWrapper, less, openssl_1_1, pam, lttng-ust }:
|
||||||
|
|
||||||
let platformString = if stdenv.isDarwin then "osx"
|
let archString = if stdenv.isAarch64 then "arm64"
|
||||||
|
else if stdenv.isx86_64 then "x64"
|
||||||
|
else throw "unsupported platform";
|
||||||
|
platformString = if stdenv.isDarwin then "osx"
|
||||||
else if stdenv.isLinux then "linux"
|
else if stdenv.isLinux then "linux"
|
||||||
else throw "unsupported platform";
|
else throw "unsupported platform";
|
||||||
platformSha = if stdenv.isDarwin then "0w44ws8b6zfixf7xz93hmplqsx18279n9x8j77y4rbzs13fldvsn"
|
platformSha = if stdenv.isDarwin then "0w44ws8b6zfixf7xz93hmplqsx18279n9x8j77y4rbzs13fldvsn"
|
||||||
else if stdenv.isLinux then "0xm7l49zhkz2fly3d751kjd5cy3ws9zji9i0061lkd06dvkch7jy"
|
else if (stdenv.isLinux && stdenv.isx86_64) then "0xm7l49zhkz2fly3d751kjd5cy3ws9zji9i0061lkd06dvkch7jy"
|
||||||
|
else if (stdenv.isLinux && stdenv.isAarch64) then "1axbi4kmb1ydys7c45jhp729w1srid3c8jgivb4bdmdp56rf6h32"
|
||||||
else throw "unsupported platform";
|
else throw "unsupported platform";
|
||||||
platformLdLibraryPath = if stdenv.isDarwin then "DYLD_FALLBACK_LIBRARY_PATH"
|
platformLdLibraryPath = if stdenv.isDarwin then "DYLD_FALLBACK_LIBRARY_PATH"
|
||||||
else if stdenv.isLinux then "LD_LIBRARY_PATH"
|
else if stdenv.isLinux then "LD_LIBRARY_PATH"
|
||||||
|
@ -18,7 +22,7 @@ stdenv.mkDerivation rec {
|
||||||
version = "7.1.3";
|
version = "7.1.3";
|
||||||
|
|
||||||
src = fetchzip {
|
src = fetchzip {
|
||||||
url = "https://github.com/PowerShell/PowerShell/releases/download/v${version}/powershell-${version}-${platformString}-x64.tar.gz";
|
url = "https://github.com/PowerShell/PowerShell/releases/download/v${version}/powershell-${version}-${platformString}-${archString}.tar.gz";
|
||||||
sha256 = platformSha;
|
sha256 = platformSha;
|
||||||
stripRoot = false;
|
stripRoot = false;
|
||||||
};
|
};
|
||||||
|
@ -42,7 +46,7 @@ stdenv.mkDerivation rec {
|
||||||
chmod a+x $pslibs/pwsh
|
chmod a+x $pslibs/pwsh
|
||||||
|
|
||||||
ls $pslibs
|
ls $pslibs
|
||||||
'' + lib.optionalString (!stdenv.isDarwin) ''
|
'' + lib.optionalString (!stdenv.isDarwin && !stdenv.isAarch64) ''
|
||||||
patchelf --replace-needed libcrypto${ext}.1.0.0 libcrypto${ext}.1.1 $pslibs/libmi.so
|
patchelf --replace-needed libcrypto${ext}.1.0.0 libcrypto${ext}.1.1 $pslibs/libmi.so
|
||||||
patchelf --replace-needed libssl${ext}.1.0.0 libssl${ext}.1.1 $pslibs/libmi.so
|
patchelf --replace-needed libssl${ext}.1.0.0 libssl${ext}.1.1 $pslibs/libmi.so
|
||||||
'' + ''
|
'' + ''
|
||||||
|
@ -66,7 +70,7 @@ stdenv.mkDerivation rec {
|
||||||
description = "Powerful cross-platform (Windows, Linux, and macOS) shell and scripting language based on .NET";
|
description = "Powerful cross-platform (Windows, Linux, and macOS) shell and scripting language based on .NET";
|
||||||
homepage = "https://github.com/PowerShell/PowerShell";
|
homepage = "https://github.com/PowerShell/PowerShell";
|
||||||
maintainers = with maintainers; [ yrashk srgom ];
|
maintainers = with maintainers; [ yrashk srgom ];
|
||||||
platforms = [ "x86_64-darwin" "x86_64-linux" ];
|
platforms = [ "x86_64-darwin" "x86_64-linux" "aarch64-linux"];
|
||||||
license = with licenses; [ mit ];
|
license = with licenses; [ mit ];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue