| 1 |
# Copyright 2019-2022, Mesa contributors |
| 2 |
# Copyright 2022, Collabora, Ltd. |
| 3 |
# SPDX-License-Identifier: MIT |
| 4 |
# Based on https://gitlab.freedesktop.org/mesa/mesa/-/blob/8396df5ad90aeb6ab2267811aba2187954562f81/.gitlab-ci/windows/mesa_deps_build.ps1 |
| 5 |
|
| 6 |
$VulkanRTVersion = "1.3.283.0" |
| 7 |
|
| 8 |
# Download new TLS certs from Windows Update |
| 9 |
Get-Date |
| 10 |
Write-Host "Updating TLS certificate store" |
| 11 |
$certdir = (New-Item -ItemType Directory -Name "_tlscerts") |
| 12 |
certutil -syncwithWU "$certdir" |
| 13 |
Foreach ($file in (Get-ChildItem -Path "$certdir\*" -Include "*.crt")) { |
| 14 |
Import-Certificate -FilePath $file -CertStoreLocation Cert:\LocalMachine\Root |
| 15 |
} |
| 16 |
Remove-Item -Recurse -Path $certdir |
| 17 |
|
| 18 |
Get-Date |
| 19 |
Write-Host "Installing runtime redistributables" |
| 20 |
Invoke-WebRequest -Uri "https://aka.ms/vs/17/release/vc_redist.x64.exe" -OutFile "C:\vcredist_x64.exe" -UseBasicParsing |
| 21 |
Start-Process -NoNewWindow -Wait "C:\vcredist_x64.exe" -ArgumentList "/install /passive /norestart /log out.txt" |
| 22 |
if (!$?) { |
| 23 |
Write-Host "Failed to install vc_redist" |
| 24 |
Exit 1 |
| 25 |
} |
| 26 |
Remove-Item "C:\vcredist_x64.exe" -Force |
| 27 |
|
| 28 |
Get-Date |
| 29 |
Write-Host "Installing Vulkan runtime components" |
| 30 |
$VulkanInstaller = "C:\VulkanRTInstaller.exe" |
| 31 |
Invoke-WebRequest -Uri "https://sdk.lunarg.com/sdk/download/$VulkanRTVersion/windows/VulkanRT-$VulkanRTVersion-Installer.exe" -OutFile "$VulkanInstaller" |
| 32 |
Start-Process -NoNewWindow -Wait "$VulkanInstaller" -ArgumentList "/S" |
| 33 |
if (!$?) { |
| 34 |
Write-Host "Failed to install Vulkan runtime components" |
| 35 |
Exit 1 |
| 36 |
} |
| 37 |
Remove-Item "$VulkanInstaller" -Force |
| 38 |
|
| 39 |
Get-Date |
| 40 |
Write-Host "Installing Scoop" |
| 41 |
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser |
| 42 |
Invoke-WebRequest get.scoop.sh -OutFile install.ps1 |
| 43 |
.\install.ps1 -RunAsAdmin |
| 44 |
scoop install git |
| 45 |
|
| 46 |
Get-Date |
| 47 |
Write-Host "Installing things from Scoop" |
| 48 |
scoop install cmake |
| 49 |
scoop install python |
| 50 |
scoop install vulkan |
| 51 |
scoop install ninja |
| 52 |
|
| 53 |
Get-Date |
| 54 |
Write-Host "Preparing vcpkg" |
| 55 |
Set-Location C:\ |
| 56 |
git clone https://github.com/microsoft/vcpkg.git |
| 57 |
Set-Location vcpkg |
| 58 |
./bootstrap-vcpkg.bat -DisableMetrics |
| 59 |
|
| 60 |
Get-Date |
| 61 |
Write-Host "Installing some base deps from vcpkg" |
| 62 |
./vcpkg.exe install cjson:x64-windows eigen3:x64-windows wil:x64-windows pthreads:x64-windows glslang:x64-windows libusb:x64-windows hidapi:x64-windows sdl2:x64-windows sdl2[vulkan]:x64-windows |
| 63 |
Remove-Item -Recurse -Path downloads |
| 64 |
Remove-Item -Recurse -Path buildtrees |