From d94a040229bc84feaff5ed07ee8d0b51620f5ff7 Mon Sep 17 00:00:00 2001 From: Andrew Schwartzmeyer Date: Wed, 13 Apr 2016 15:11:38 -0700 Subject: [PATCH] Add Start-PSBootstrap function Installs Open PowerShell build dependenices on all platform; deprecates `bootstrap.sh`. --- PowerShellGitHubDev.psm1 | 50 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/PowerShellGitHubDev.psm1 b/PowerShellGitHubDev.psm1 index 3cc1a739d7..d0c2f8a89c 100644 --- a/PowerShellGitHubDev.psm1 +++ b/PowerShellGitHubDev.psm1 @@ -261,6 +261,56 @@ function Start-PSxUnit { } } + +function Start-PSBootstrap { + [CmdletBinding()]param() + + Write-Host "Installing Open PowerShell build dependencies" + + if ($IsLinux) { + precheck 'curl' "Bootstrap dependency 'curl' not found in PATH, please install!" > $null + precheck 'apt-get' "Bootstrap dependency 'apt-get' not found in PATH, this only supports Ubuntu 14.04!" > $null + + # Setup LLVM feed + curl -s http://llvm.org/apt/llvm-snapshot.gpg.key | sudo apt-key add - + echo "deb http://llvm.org/apt/trusty/ llvm-toolchain-trusty-3.6 main" | sudo tee /etc/apt/sources.list.d/llvm.list + sudo apt-get update -qq + + # Install ours and .NET's dependencies + sudo apt-get install -y wget make g++ cmake libc6 libgcc1 libstdc++6 libcurl3 libgssapi-krb5-2 libicu52 liblldb-3.6 liblttng-ust0 libssl1.0.0 libunwind8 libuuid1 zlib1g clang-3.5 + + # Install .NET CLI packages + Remove-Item dotnet*.deb + + wget https://dotnetcli.blob.core.windows.net/dotnet/beta/Installers/Latest/dotnet-host-ubuntu-x64.latest.deb + sudo dpkg -i dotnet-host-ubuntu-x64.latest.deb + + wget https://dotnetcli.blob.core.windows.net/dotnet/beta/Installers/Latest/dotnet-sharedframework-ubuntu-x64.latest.deb + sudo dpkg -i dotnet-sharedframework-ubuntu-x64.latest.deb + + wget https://dotnetcli.blob.core.windows.net/dotnet/beta/Installers/Latest/dotnet-sdk-ubuntu-x64.latest.deb + sudo dpkg -i dotnet-sdk-ubuntu-x64.latest.deb + + } elseif ($IsOSX) { + precheck 'brew' "Bootstrap dependency 'brew' not found, must install Homebrew! See http://brew.sh/" + + # Install ours and .NET's dependencies + brew install cmake wget openssl + + # Install .NET CLI packages + Remove-Item dotnet*.pkg + wget https://dotnetcli.blob.core.windows.net/dotnet/beta/Installers/Latest/dotnet-dev-osx-x64.latest.pkg + sudo installer -pkg dotnet-dev-osx-x64.latest.pkg -target / + } elseif ($IsWindows -And -Not $IsCore) { + Invoke-WebRequest -Uri https://raw.githubusercontent.com/dotnet/cli/rel/1.0.0/scripts/obtain/install.ps1 -OutFile install.ps1 + ./install.ps1 + $env:Path += ";$env:LocalAppData\Microsoft\dotnet\cli" + } else { + Write-Warning "Start-PSBootstrap cannot be run in Core PowerShell on Windows (need Invoke-WebRequest!)" + } +} + + function Start-PSPackage { [CmdletBinding()]param( # PowerShell packages use Semantic Versioning http://semver.org/