summaryrefslogtreecommitdiffstats
path: root/.gitlab/ci/mingw.ps1
diff options
context:
space:
mode:
Diffstat (limited to '.gitlab/ci/mingw.ps1')
-rwxr-xr-x.gitlab/ci/mingw.ps125
1 files changed, 25 insertions, 0 deletions
diff --git a/.gitlab/ci/mingw.ps1 b/.gitlab/ci/mingw.ps1
new file mode 100755
index 0000000..a1b5b11
--- /dev/null
+++ b/.gitlab/ci/mingw.ps1
@@ -0,0 +1,25 @@
+$erroractionpreference = "stop"
+
+if ("$env:CMAKE_CONFIGURATION".Contains("mingw_osdn_io")) {
+ $filename = "mingw.osdn.io-2022-10-03"
+ $sha256sum = "4DCB8C351D8D855F7D3DFC2863A235042BF3DB6E69EA0BAE51FF9378189345CD"
+} else {
+ throw ('unknown CMAKE_CONFIGURATION: ' + "$env:CMAKE_CONFIGURATION")
+}
+$tarball = "$filename.zip"
+
+$outdir = $pwd.Path
+$outdir = "$outdir\.gitlab"
+$ProgressPreference = 'SilentlyContinue'
+Invoke-WebRequest -Uri "https://cmake.org/files/dependencies/$tarball" -OutFile "$outdir\$tarball"
+$hash = Get-FileHash "$outdir\$tarball" -Algorithm SHA256
+if ($hash.Hash -ne $sha256sum) {
+ exit 1
+}
+
+Add-Type -AssemblyName System.IO.Compression.FileSystem
+[System.IO.Compression.ZipFile]::ExtractToDirectory("$outdir\$tarball", "$outdir")
+Move-Item -Path "$outdir\$filename" -Destination "$outdir\mingw"
+Remove-Item "$outdir\$tarball"
+
+"$outdir/mingw /mingw" -replace '\\', '/' | Out-File -FilePath "$outdir\mingw\msys\1.0\etc\fstab" -Encoding ASCII