CI: Install gettext for Windows

Before that the gettext command shipping with git for Windows were used.
Since git 2.44.0 these are no longer bundled.
This commit is contained in:
Philipp Wolfer
2024-02-29 13:19:00 +01:00
parent 4ac5dd48d5
commit a769561dd8
6 changed files with 76 additions and 26 deletions

View File

@@ -56,3 +56,30 @@ Function FinalizePackage {
Move-Item -Path (Join-Path -Path $Qt6Dir -ChildPath bin\*.dll) -Destination $Path -Force
Remove-Item -Path (Join-Path -Path $Qt6Dir -ChildPath bin)
}
Function DownloadFile {
Param(
[Parameter(Mandatory = $true)]
[String]
$FileName,
[Parameter(Mandatory = $true)]
[String]
$Url
)
$OutputPath = (Join-Path (Resolve-Path .) $FileName)
(New-Object System.Net.WebClient).DownloadFile($Url, "$OutputPath")
}
Function VerifyHash {
Param(
[Parameter(Mandatory = $true)]
[String]
$FileName,
[Parameter(Mandatory = $true)]
[String]
$Sha256Sum
)
If ((Get-FileHash "$FileName").hash -ne "$Sha256Sum") {
Throw "Invalid SHA256 hash for $FileName"
}
}

View File

@@ -0,0 +1,20 @@
Param(
[Parameter(Mandatory = $true)]
[String]
$GettextVersion,
[Parameter(Mandatory = $true)]
[String]
$GettextSha256Sum
)
$ErrorActionPreference = "Stop"
$ScriptDirectory = Split-Path -Path $MyInvocation.MyCommand.Definition -Parent
. $ScriptDirectory\win-common.ps1
$ArchiveFile = ".\gettext-tools-windows.zip"
Write-Output "Downloading gettext-tools-windows $GettextVersion to $ArchiveFile..."
DownloadFile -Url "https://github.com/vslavik/gettext-tools-windows/releases/download/v$GettextVersion/gettext-tools-windows-$GettextVersion.zip" `
-FileName $ArchiveFile
VerifyHash -FileName $ArchiveFile -Sha256Sum $GettextSha256Sum
Expand-Archive -Path $ArchiveFile -DestinationPath .\gettext -Force

View File

@@ -15,32 +15,8 @@ Param(
$ErrorActionPreference = "Stop"
Function DownloadFile {
Param(
[Parameter(Mandatory=$true)]
[String]
$FileName,
[Parameter(Mandatory=$true)]
[String]
$Url
)
$OutputPath = (Join-Path (Resolve-Path .) $FileName)
(New-Object System.Net.WebClient).DownloadFile($Url, "$OutputPath")
}
Function VerifyHash {
Param(
[Parameter(Mandatory = $true)]
[String]
$FileName,
[Parameter(Mandatory = $true)]
[String]
$Sha256Sum
)
If ((Get-FileHash "$FileName").hash -ne "$Sha256Sum") {
Throw "Invalid SHA256 hash for $FileName"
}
}
$ScriptDirectory = Split-Path -Path $MyInvocation.MyCommand.Definition -Parent
. $ScriptDirectory\win-common.ps1
New-Item -Name .\build -ItemType Directory -ErrorAction Ignore