From 9a9b7bc5ced6785030339b9292546a00117f2574 Mon Sep 17 00:00:00 2001 From: Jordan Petridis Date: Wed, 17 Aug 2022 17:31:28 +0300 Subject: [PATCH] ci: Install gtk on the windows image So we can use it in gst-plugins-rs CI. Part-of: --- ci/windows-docker/Dockerfile | 6 ++++-- ci/windows-docker/install_gtk.ps1 | 29 +++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 ci/windows-docker/install_gtk.ps1 diff --git a/ci/windows-docker/Dockerfile b/ci/windows-docker/Dockerfile index 27b22d5fa..6caed1b82 100644 --- a/ci/windows-docker/Dockerfile +++ b/ci/windows-docker/Dockerfile @@ -9,10 +9,12 @@ SHELL ["powershell","-NoLogo", "-NonInteractive", "-Command"] ARG DEFAULT_BRANCH="main" ARG RUST_VERSION="invalid" -COPY install_gst.ps1 C:\ -RUN C:\install_gst.ps1 RUN choco install -y pkgconfiglite ENV PKG_CONFIG_PATH="C:/lib/pkgconfig" +COPY install_gst.ps1 install_gtk.ps1 C:\ +RUN C:\install_gst.ps1 +RUN C:\install_gtk.ps1 + RUN Invoke-WebRequest -Uri https://win.rustup.rs/x86_64 -OutFile C:\rustup-init.exe RUN C:\rustup-init.exe -y --profile minimal --default-toolchain $env:RUST_VERSION diff --git a/ci/windows-docker/install_gtk.ps1 b/ci/windows-docker/install_gtk.ps1 new file mode 100644 index 000000000..0f9270bba --- /dev/null +++ b/ci/windows-docker/install_gtk.ps1 @@ -0,0 +1,29 @@ +[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; + +$env:Path += ";C:\gst-install\bin\" + +# Download gstreamer and all its subprojects +git clone -b gtk-4-6 --depth 1 https://gitlab.gnome.org/gnome/gtk.git C:\gtk +if (!$?) { + Write-Host "Failed to clone gtk" + Exit 1 +} + +Set-Location C:\gtk + +$env:MESON_ARGS = "" + +Write-Output "Building gtk" +cmd.exe /C "C:\BuildTools\Common7\Tools\VsDevCmd.bat -host_arch=amd64 -arch=amd64 && meson _build $env:MESON_ARGS && meson compile -C _build && ninja -C _build install" + +if (!$?) { + Write-Host "Failed to build and install gtk" + Exit 1 +} + +cd C:\ +cmd /c rmdir /s /q C:\gtk +if (!$?) { + Write-Host "Failed to remove gtk checkout" + Exit 1 +}