@@ -144,6 +144,7 @@ function Get-EnvironmentInformation
144144 $environment += @ {' IsOpenSUSE42.1' = $Environment.IsOpenSUSE -and $LinuxInfo.VERSION_ID -match ' 42.1' }
145145 $environment += @ {' IsRedHatFamily' = $Environment.IsCentOS -or $Environment.IsFedora }
146146 $environment += @ {' IsSUSEFamily' = $Environment.IsSLES -or $Environment.IsOpenSUSE }
147+ $environment += @ {' IsAlpine' = $LinuxInfo.ID -match ' alpine' }
147148
148149 # Workaround for temporary LD_LIBRARY_PATH hack for Fedora 24
149150 # https://github.com/PowerShell/PowerShell/issues/2511
@@ -491,6 +492,10 @@ function Start-BuildPowerShellNativePackage
491492 [ValidateScript ({Test-Path $_ - PathType Leaf})]
492493 [string ] $LinuxARMZipPath ,
493494
495+ [Parameter (Mandatory = $true )]
496+ [ValidateScript ({Test-Path $_ - PathType Leaf})]
497+ [string ] $LinuxAlpineZipPath ,
498+
494499 [Parameter (Mandatory = $true )]
495500 [ValidateScript ({Test-Path $_ - PathType Leaf})]
496501 [string ] $macOSZipPath ,
@@ -520,6 +525,7 @@ function Start-BuildPowerShellNativePackage
520525 $BinFolderARM64 = Join-Path $tempExtractionPath " ARM64"
521526 $BinFolderLinux = Join-Path $tempExtractionPath " Linux"
522527 $BinFolderLinuxARM = Join-Path $tempExtractionPath " LinuxARM"
528+ $BinFolderLinuxAlpine = Join-Path $tempExtractionPath " LinuxAlpine"
523529 $BinFolderMacOS = Join-Path $tempExtractionPath " MacOS"
524530 $BinFolderPSRP = Join-Path $tempExtractionPath " PSRP"
525531
@@ -528,13 +534,14 @@ function Start-BuildPowerShellNativePackage
528534 Expand-Archive - Path $WindowsARMZipPath - DestinationPath $BinFolderARM - Force
529535 Expand-Archive - Path $WindowsARM64ZipPath - DestinationPath $BinFolderARM64 - Force
530536 Expand-Archive - Path $LinuxZipPath - DestinationPath $BinFolderLinux - Force
537+ Expand-Archive - Path $LinuxAlpineZipPath - DestinationPath $BinFolderLinuxAlpine - Force
531538 Expand-Archive - Path $LinuxARMZipPath - DestinationPath $BinFolderLinuxARM - Force
532539 Expand-Archive - Path $macOSZipPath - DestinationPath $BinFolderMacOS - Force
533540 Expand-Archive - Path $psrpZipPath - DestinationPath $BinFolderPSRP - Force
534541
535542 PlaceWindowsNativeBinaries - PackageRoot $PackageRoot - BinFolderX64 $BinFolderX64 - BinFolderX86 $BinFolderX86 - BinFolderARM $BinFolderARM - BinFolderARM64 $BinFolderARM64
536543
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
538545
539546 $Nuspec = @'
540547<?xml version="1.0" encoding="utf-8"?>
@@ -599,6 +606,10 @@ function PlaceUnixBinaries
599606 [ValidateScript ({Test-Path $_ - PathType Container})]
600607 $BinFolderLinuxARM ,
601608
609+ [Parameter (Mandatory = $true )]
610+ [ValidateScript ({Test-Path $_ - PathType Container})]
611+ $BinFolderLinuxAlpine ,
612+
602613 [Parameter (Mandatory = $true )]
603614 [ValidateScript ({Test-Path $_ - PathType Container})]
604615 $BinFolderOSX ,
@@ -610,10 +621,12 @@ function PlaceUnixBinaries
610621
611622 $RuntimePathLinux = New-Item - ItemType Directory - Path (Join-Path $PackageRoot - ChildPath ' runtimes/linux-x64/native' ) - Force
612623 $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
613625 $RuntimePathOSX = New-Item - ItemType Directory - Path (Join-Path $PackageRoot - ChildPath ' runtimes/osx/native' ) - Force
614626
615627 Copy-Item " $BinFolderLinux \*" - Destination $RuntimePathLinux - Verbose
616628 Copy-Item " $BinFolderLinuxARM \*" - Destination $RuntimePathLinuxARM - Verbose
629+ Copy-Item " $BinFolderLinuxAlpine \*" - Destination $RuntimePathLinuxAlpine - Verbose
617630 Copy-Item " $BinFolderOSX \*" - Destination $RuntimePathOSX - Verbose
618631
619632 # # LinuxARM is not supported by PSRP
@@ -1979,6 +1992,12 @@ function Start-PSBootstrap {
19791992
19801993 # Install patched version of curl
19811994 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 }
19822001 }
19832002
19842003 # Install [fpm](https://github.com/jordansissel/fpm) and [ronn](https://github.com/rtomayko/ronn)
0 commit comments