summaryrefslogtreecommitdiff
path: root/.gitlab-ci/windows
diff options
context:
space:
mode:
authorErik Faye-Lund <erik.faye-lund@collabora.com>2020-06-03 18:06:56 +0200
committerErik Faye-Lund <erik.faye-lund@collabora.com>2020-12-02 10:04:48 +0100
commit76b51fdf0c4205e78a94eefb359b2abec061dd2f (patch)
tree3c209673c00b023597ec7e53e230969701221376 /.gitlab-ci/windows
parent04e3693e6d64d2d067c869d7ed697b25bb8d3a35 (diff)
downloadmesa-76b51fdf0c4205e78a94eefb359b2abec061dd2f.tar.gz
gitlab-ci: build piglit in mesa_deps.ps1
This will allow us to run Piglit on Windows during CI. Reviewed-by: Daniel Stone <daniels@collabora.com> Reviewed-by: Eric Anholt <eric@anholt.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7857>
Diffstat (limited to '.gitlab-ci/windows')
-rw-r--r--.gitlab-ci/windows/mesa_deps.ps165
1 files changed, 63 insertions, 2 deletions
diff --git a/.gitlab-ci/windows/mesa_deps.ps1 b/.gitlab-ci/windows/mesa_deps.ps1
index fa070152d62..549cc91b573 100644
--- a/.gitlab-ci/windows/mesa_deps.ps1
+++ b/.gitlab-ci/windows/mesa_deps.ps1
@@ -32,8 +32,8 @@ $env:PATH = "C:\python3;C:\python3\scripts;C:\Program Files\CMake\bin;$env:PATH"
Start-Process -NoNewWindow -Wait git -ArgumentList 'config --global core.autocrlf false'
Get-Date
-Write-Host "Installing Meson and Mako"
-pip3 install meson mako
+Write-Host "Installing Meson, Mako and numpy"
+pip3 install meson mako numpy
if (!$?) {
Write-Host "Failed to install dependencies from pip"
Exit 1
@@ -129,4 +129,65 @@ if (!$buildstatus) {
}
Get-Date
+Write-Host "Downloading Freeglut"
+
+$freeglut_zip = 'freeglut-MSVC.zip'
+$freeglut_url = "https://www.transmissionzero.co.uk/files/software/development/GLUT/$freeglut_zip"
+
+For ($i = 0; $i -lt 5; $i++) {
+ Invoke-WebRequest -Uri $freeglut_url -OutFile $freeglut_zip
+ $freeglut_downloaded = $?
+ if ($freeglut_downloaded) {
+ Break
+ }
+}
+
+if (!$freeglut_downloaded) {
+ Write-Host "Failed to download Freeglut"
+ Exit 1
+}
+
+Get-Date
+Write-Host "Installing Freeglut"
+Expand-Archive $freeglut_zip -DestinationPath C:\
+if (!$?) {
+ Write-Host "Failed to install Freeglut"
+ Exit 1
+}
+
+Get-Date
+Write-Host "Downloading glext.h"
+New-Item -ItemType Directory -Path ".\glext" -Name "GL"
+$ProgressPreference = "SilentlyContinue"
+Invoke-WebRequest -Uri 'https://www.khronos.org/registry/OpenGL/api/GL/glext.h' -OutFile '.\glext\GL\glext.h' | Out-Null
+
+Get-Date
+Write-Host "Cloning Piglit"
+git clone --no-progress --single-branch --no-checkout https://gitlab.freedesktop.org/mesa/piglit.git 'C:\src\piglit'
+if (!$?) {
+ Write-Host "Failed to clone Piglit repository"
+ Exit 1
+}
+Push-Location -Path C:\src\piglit
+git checkout f8767f9c9d0afe0ce8d37ddd80a61f73ccfb1cc6
+Pop-Location
+
+Get-Date
+$piglit_build = New-Item -ItemType Directory -Path "C:\src\piglit" -Name "build"
+Push-Location -Path $piglit_build.FullName
+Write-Host "Compiling Piglit"
+cmd.exe /C 'C:\BuildTools\Common7\Tools\VsDevCmd.bat -host_arch=amd64 -arch=amd64 && cmake .. -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="C:\Piglit" -DGLUT_INCLUDE_DIR=C:\freeglut\include -DGLUT_glut_LIBRARY_RELEASE=C:\freeglut\lib\x64\freeglut.lib -DGLEXT_INCLUDE_DIR=.\glext && ninja -j32'
+$buildstatus = $?
+ninja -j32 install | Out-Null
+$installstatus = $?
+Pop-Location
+Remove-Item -Recurse -Path $piglit_build
+if (!$buildstatus -Or !$installstatus) {
+ Write-Host "Failed to compile or install Piglit"
+ Exit 1
+}
+
+Copy-Item -Path C:\freeglut\bin\x64\freeglut.dll -Destination C:\Piglit\lib\piglit\bin\freeglut.dll
+
+Get-Date
Write-Host "Complete"