@ -1,5 +1,5 @@
{ stdenv , fetchgit , autoPatchelfHook , fetchzip , libunwind , libuuid , icu , curl , cacert ,
makeWrapper , less , openssl } :
{ stdenv , fetchgit , autoPatchelfHook , fetchzip , libunwind , libuuid , icu , curl ,
makeWrapper , less , openssl , pam , lttng-ust } :
let platformString = if stdenv . isDarwin then " o s x "
else if stdenv . isLinux then " l i n u x "
@ -10,6 +10,7 @@ let platformString = if stdenv.isDarwin then "osx"
platformLdLibraryPath = if stdenv . isDarwin then " D Y L D _ F A L L B A C K _ L I B R A R Y _ P A T H "
else if stdenv . isLinux then " L D _ L I B R A R Y _ P A T H "
else throw " u n s u p p o r t e d p l a t f o r m " ;
libraries = [ libunwind libuuid icu curl openssl lttng-ust ] ++ ( if stdenv . isLinux then [ pam ] else [ ] ) ;
in
stdenv . mkDerivation rec {
name = " p o w e r s h e l l - ${ version } " ;
@ -21,8 +22,7 @@ stdenv.mkDerivation rec {
stripRoot = false ;
} ;
buildInputs = [ autoPatchelfHook makeWrapper ] ;
propagatedBuildInputs = [ libunwind libuuid icu curl cacert less openssl ] ;
buildInputs = [ autoPatchelfHook makeWrapper less ] ++ libraries ;
# TODO: remove PAGER after upgrading to v6.1.0-preview.1 or later as it has been addressed in
# https://github.com/PowerShell/PowerShell/pull/6144
@ -31,7 +31,7 @@ stdenv.mkDerivation rec {
mkdir - p $ out/share/powershell
cp - r * $ out/share/powershell
rm $ out/share/powershell/DELETE_ME_TO_DISABLE_CONSOLEHOST_TELEMETRY
makeWrapper $ out/share/powershell/pwsh $ out/bin/pwsh - - prefix $ { platformLdLibraryPath } : " ${ stdenv . lib . makeLibraryPath [ libunwind libuuid icu openssl curl ] } " \
makeWrapper $ out/share/powershell/pwsh $ out/bin/pwsh - - prefix $ { platformLdLibraryPath } : " ${ stdenv . lib . makeLibraryPath libraries } " \
- - set PAGER $ { less } /bin/less - - set TERM xterm
'' ;