Commit 31cec0a2 authored by Xavier Claessens's avatar Xavier Claessens Committed by Xavier Claessens

Add Windows MSVC and MSYS2 builds

This adds 3 new jobs that build against msys2 x86_64, msvc 2017 x86
and msvc 2017 x86_64. For the msvc build, some subprojects (like libnice)
don't satisfy all their deps, and are getting automatically disabled.

This doesn't add jobs that run the test suite also. Will hopefully
get implemented later on.
parent fd89f33d
# escape=`
# Make sure any failure in PowerShell scripts is fatal
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop';"]
COPY prepare.ps1 cleanup.ps1 C:\
RUN C:\prepare.ps1 ; C:\cleanup.ps1
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12;
Write-Host "Installing VisualStudio"
Invoke-WebRequest -Uri '' -OutFile C:\vs_buildtools.exe
Start-Process C:\vs_buildtools.exe -ArgumentList '--quiet --wait --norestart --nocache --installPath C:\BuildTools --add Microsoft.VisualStudio.Workload.VCTools --includeRecommended' -Wait
Remove-Item C:\vs_buildtools.exe -Force
Write-Host "Installing Python"
Invoke-WebRequest -Uri '' -OutFile C:\python-3.7.0.exe
Start-Process C:\python-3.7.0.exe -ArgumentList '/quiet InstallAllUsers=1 PrependPath=1' -Wait
Remove-Item C:\python-3.7.0.exe -Force
Write-Host "Installing Git"
Invoke-WebRequest -Uri '' -OutFile C:\
Expand-Archive C:\ -DestinationPath c:\mingit
Remove-Item C:\ -Force
$env:PATH = [System.Environment]::GetEnvironmentVariable('PATH', 'Machine') + ';' + 'c:\mingit\cmd'
[Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine)
Write-Host "Installing 7zip"
Invoke-WebRequest -Uri '' -OutFile C:\7z-x64.exe
Start-Process C:\7z-x64.exe -ArgumentList '/S /D=C:\7zip\' -Wait
Remove-Item C:\7z-x64.exe -Force
Write-Host "Installing MSYS2"
Invoke-WebRequest -Uri '' -OutFile C:\msys2-x86_64.tar.xz
C:\7zip\7z e C:\msys2-x86_64.tar.xz -Wait
C:\7zip\7z x C:\msys2-x86_64.tar -o"C:\\"
Remove-Item C:\msys2-x86_64.tar.xz -Force
Remove-Item C:\msys2-x86_64.tar -Force
Remove-Item C:\7zip -Recurse -Force
# FIXME: This works but then docker fails to save the image. Needs to investigate why.
#$env:PATH += ";C:\msys64\usr\bin;C:\msys64\mingw64/bin;C:\msys64\mingw32/bin"
#C:\msys64\usr\bin\bash -c "pacman-key --init && pacman-key --populate msys2 && pacman-key --refresh-keys"
#C:\msys64\usr\bin\bash -c "pacman -Syuu --noconfirm"
#C:\msys64\usr\bin\bash -c "pacman -Sy --noconfirm --needed mingw-w64-x86_64-toolchain ninja"
pip install meson
git config --global ""
git config --global "Gstbuild Runner"
# Download gst-build and all its subprojects
git clone C:\gst-build
meson subprojects download --sourcedir C:\gst-build
......@@ -20,7 +20,6 @@ variables:
MESON_BUILDTYPE_ARGS: --default-library=both
......@@ -82,7 +81,7 @@ gst indent:
- ccache -z
......@@ -346,6 +345,64 @@ valgrind ges:
- "${CERBERO_HOME}/logs"
- "*.tar.bz2"
.build windows:
image: ''
stage: 'build'
- 'manifest'
- 'docker'
- 'windows'
- '1607'
# For some reason, options are separated by newline instead of space, so we
# have to replace them first.
- $env:MESON_ARGS = $env:MESON_ARGS.replace("`n"," ")
# Gitlab executes PowerShell in docker, but VsDevCmd.bat is a batch script.
# Environment variables substitutions is done by PowerShell before calling
# cmd.exe, that's why we use $env:FOO instead of %FOO%
- cmd.exe /C "C:\BuildTools\Common7\Tools\VsDevCmd.bat -host_arch=amd64 -arch=$env:ARCH &&
cd C:\gst-build &&
python git-update --no-interaction --manifest=$env:CI_PROJECT_DIR/manifest.xml &&
meson build $env:MESON_ARGS &&
ninja -C build"
# FIXME: cleanup build dir for artifacts.
build vs2017 amd64:
extends: '.build windows'
ARCH: 'amd64'
build vs2017 x86:
extends: '.build windows'
ARCH: 'x86'
build msys2 :
extends: '.build windows'
- $env:PATH += ";C:\msys64\usr\bin;C:\msys64\mingw64/bin;C:\msys64\mingw32/bin"
# FIXME: This should be done in Dockerfile, but doesn't work there. Needs to investigate why.
- C:\msys64\usr\bin\bash -c "pacman-key --init && pacman-key --populate msys2 && pacman-key --refresh-keys || true"
- C:\msys64\usr\bin\bash -c "pacman -Syu --noconfirm"
- C:\msys64\usr\bin\bash -c "pacman -Sy --noconfirm --needed mingw-w64-x86_64-toolchain ninja"
# For some reason, options are separated by newline instead of space, so we
# have to replace them first.
- $env:MESON_ARGS = $env:MESON_ARGS.replace("`n"," ")
- C:\msys64\usr\bin\bash -c "cd /c/gst-build &&
python git-update --no-interaction --manifest=$env:CI_PROJECT_DIR/manifest.xml &&
meson build $env:MESON_ARGS &&
ninja -C build"
# Template for Cerbero GStreamer Deps
# This template is used by cerbero/ project to pre-built the GStreamer
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment