@@ -144,6 +144,7 @@ function Get-EnvironmentInformation
144
144
$environment += @ {' IsOpenSUSE42.1' = $Environment.IsOpenSUSE -and $LinuxInfo.VERSION_ID -match ' 42.1' }
145
145
$environment += @ {' IsRedHatFamily' = $Environment.IsCentOS -or $Environment.IsFedora }
146
146
$environment += @ {' IsSUSEFamily' = $Environment.IsSLES -or $Environment.IsOpenSUSE }
147
+ $environment += @ {' IsAlpine' = $LinuxInfo.ID -match ' alpine' }
147
148
148
149
# Workaround for temporary LD_LIBRARY_PATH hack for Fedora 24
149
150
# https://github.com/PowerShell/PowerShell/issues/2511
@@ -491,6 +492,10 @@ function Start-BuildPowerShellNativePackage
491
492
[ValidateScript ({Test-Path $_ - PathType Leaf})]
492
493
[string ] $LinuxARMZipPath ,
493
494
495
+ [Parameter (Mandatory = $true )]
496
+ [ValidateScript ({Test-Path $_ - PathType Leaf})]
497
+ [string ] $LinuxAlpineZipPath ,
498
+
494
499
[Parameter (Mandatory = $true )]
495
500
[ValidateScript ({Test-Path $_ - PathType Leaf})]
496
501
[string ] $macOSZipPath ,
@@ -520,6 +525,7 @@ function Start-BuildPowerShellNativePackage
520
525
$BinFolderARM64 = Join-Path $tempExtractionPath " ARM64"
521
526
$BinFolderLinux = Join-Path $tempExtractionPath " Linux"
522
527
$BinFolderLinuxARM = Join-Path $tempExtractionPath " LinuxARM"
528
+ $BinFolderLinuxAlpine = Join-Path $tempExtractionPath " LinuxAlpine"
523
529
$BinFolderMacOS = Join-Path $tempExtractionPath " MacOS"
524
530
$BinFolderPSRP = Join-Path $tempExtractionPath " PSRP"
525
531
@@ -528,13 +534,14 @@ function Start-BuildPowerShellNativePackage
528
534
Expand-Archive - Path $WindowsARMZipPath - DestinationPath $BinFolderARM - Force
529
535
Expand-Archive - Path $WindowsARM64ZipPath - DestinationPath $BinFolderARM64 - Force
530
536
Expand-Archive - Path $LinuxZipPath - DestinationPath $BinFolderLinux - Force
537
+ Expand-Archive - Path $LinuxAlpineZipPath - DestinationPath $BinFolderLinuxAlpine - Force
531
538
Expand-Archive - Path $LinuxARMZipPath - DestinationPath $BinFolderLinuxARM - Force
532
539
Expand-Archive - Path $macOSZipPath - DestinationPath $BinFolderMacOS - Force
533
540
Expand-Archive - Path $psrpZipPath - DestinationPath $BinFolderPSRP - Force
534
541
535
542
PlaceWindowsNativeBinaries - PackageRoot $PackageRoot - BinFolderX64 $BinFolderX64 - BinFolderX86 $BinFolderX86 - BinFolderARM $BinFolderARM - BinFolderARM64 $BinFolderARM64
536
543
537
- PlaceUnixBinaries - PackageRoot $PackageRoot - BinFolderLinux $BinFolderLinux - BinFolderLinuxARM $BinFolderLinuxARM - BinFolderOSX $BinFolderMacOS - BinFolderPSRP $BinFolderPSRP
544
+ PlaceUnixBinaries - PackageRoot $PackageRoot - BinFolderLinux $BinFolderLinux - BinFolderLinuxARM $BinFolderLinuxARM - BinFolderOSX $BinFolderMacOS - BinFolderPSRP $BinFolderPSRP - BinFolderLinuxAlpine $BinFolderLinuxAlpine
538
545
539
546
$Nuspec = @'
540
547
<?xml version="1.0" encoding="utf-8"?>
@@ -599,6 +606,10 @@ function PlaceUnixBinaries
599
606
[ValidateScript ({Test-Path $_ - PathType Container})]
600
607
$BinFolderLinuxARM ,
601
608
609
+ [Parameter (Mandatory = $true )]
610
+ [ValidateScript ({Test-Path $_ - PathType Container})]
611
+ $BinFolderLinuxAlpine ,
612
+
602
613
[Parameter (Mandatory = $true )]
603
614
[ValidateScript ({Test-Path $_ - PathType Container})]
604
615
$BinFolderOSX ,
@@ -610,10 +621,12 @@ function PlaceUnixBinaries
610
621
611
622
$RuntimePathLinux = New-Item - ItemType Directory - Path (Join-Path $PackageRoot - ChildPath ' runtimes/linux-x64/native' ) - Force
612
623
$RuntimePathLinuxARM = New-Item - ItemType Directory - Path (Join-Path $PackageRoot - ChildPath ' runtimes/linux-arm/native' ) - Force
624
+ $RuntimePathLinuxAlpine = New-Item - ItemType Directory - Path (Join-Path $PackageRoot - ChildPath ' runtimes/linux-musl-x64/native' ) - Force
613
625
$RuntimePathOSX = New-Item - ItemType Directory - Path (Join-Path $PackageRoot - ChildPath ' runtimes/osx/native' ) - Force
614
626
615
627
Copy-Item " $BinFolderLinux \*" - Destination $RuntimePathLinux - Verbose
616
628
Copy-Item " $BinFolderLinuxARM \*" - Destination $RuntimePathLinuxARM - Verbose
629
+ Copy-Item " $BinFolderLinuxAlpine \*" - Destination $RuntimePathLinuxAlpine - Verbose
617
630
Copy-Item " $BinFolderOSX \*" - Destination $RuntimePathOSX - Verbose
618
631
619
632
# # LinuxARM is not supported by PSRP
@@ -1979,6 +1992,12 @@ function Start-PSBootstrap {
1979
1992
1980
1993
# Install patched version of curl
1981
1994
Start-NativeExecution { brew install curl -- with- openssl -- with- gssapi } - IgnoreExitcode
1995
+ } elseif ($Environment.IsAlpine ) {
1996
+ $Deps += " build-base" , " gcc" , " abuild" , " binutils" , " git" , " python" , " bash" , " cmake"
1997
+
1998
+ # Install dependencies
1999
+ Start-NativeExecution { apk update }
2000
+ Start-NativeExecution { apk add $Deps }
1982
2001
}
1983
2002
1984
2003
# Install [fpm](https://github.com/jordansissel/fpm) and [ronn](https://github.com/rtomayko/ronn)
0 commit comments