Build additional packages for Qt 5 on Appveyor (#4855)

Bring back old configuration that was using Qt 5 and split Qt build in
two to support both Qt 5 and Qt 6. Last Qt 5 builds were using 5.14.2,
bump that to latest 5.15.8.

Qt 6 only supports Windows 10+, so adjust the system version check
accordingly. Not bumping Qt 6 version (although 6.4.2 is available)
while we're still in patch release mode.

Building a whole new package is not nice since Qt client is only one
part of it, the rest doesn't require newer OS version. Nevertheless,
it's a quick and easy fix.
This commit is contained in:
Mike Gelfand 2023-02-13 01:12:09 +03:00 committed by GitHub
parent 0be7091eb1
commit dcd7501211
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 166 additions and 22 deletions

View File

@ -11,8 +11,16 @@ environment:
matrix:
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
TR_ARCH: x86
QT_VERSION: '5'
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
TR_ARCH: x86
QT_VERSION: '6'
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
TR_ARCH: x64
QT_VERSION: '5'
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
TR_ARCH: x64
QT_VERSION: '6'
branches:
only:
@ -80,6 +88,7 @@ for:
-Mode Build `
-BuildArch $env:TR_ARCH `
-CCachePart App `
-UseQtVersion $Env:QT_VERSION `
-PackDebugSyms:$($Env:APPVEYOR_REPO_BRANCH -eq "main" -or $Env:APPVEYOR_REPO_TAG -eq "true")
} catch {
Write-Error ("{1}{0}{2}{0}{3}" -f [Environment]::NewLine, $_.ToString(), $_.InvocationInfo.PositionMessage, $_.ScriptStackTrace) -ErrorAction Continue

View File

@ -29,6 +29,9 @@ set(MSI_FILENAME_VERSION "${TR_SEMVER}")
if(NOT TR_STABLE_RELEASE AND NOT "${TR_VCS_REVISION}" STREQUAL "")
string(APPEND MSI_FILENAME_VERSION "+r${TR_VCS_REVISION}")
endif()
if(NOT Qt_VERSION_MAJOR EQUAL 6)
string(APPEND MSI_FILENAME_VERSION "-qt${Qt_VERSION_MAJOR}")
endif()
if(NOT TR_THIRD_PARTY_DIR)
set(TR_THIRD_PARTY_DIR "$<TARGET_FILE_DIR:OpenSSL::SSL>/..")

View File

@ -17,8 +17,20 @@
<Package Id="*" Keywords="Installer" Description="Transmission $(var.TrVersion) Installer" Comments="A Fast, Easy, and Free BitTorrent Client" Manufacturer="Transmission Project" InstallerVersion="500" InstallScope="perMachine" Languages="1033" Compressed="yes" SummaryCodepage="1252" />
<MajorUpgrade DowngradeErrorMessage="A later version of [ProductName] is already installed. Setup will now exit." AllowSameVersionUpgrades="yes" />
<Condition Message="This application is only supported on Windows Vista, Windows Server 2008, or higher.">
Installed OR (VersionNT &gt;= 600)
<?if $(var.QtMajorVer) = 5 ?>
<?define MinSystemName = "Windows Vista, Windows Server 2008, or higher" ?>
<?define MinSystemCondition = "(VersionNT >= 600)" ?>
<?else ?>
<!-- https://support.microsoft.com/en-us/help/3202260/versionnt-value-for-windows-10-and-windows-server-2016 -->
<Property Id="WINDOWSBUILDNUM" Secure="yes">
<RegistrySearch Id="OsMajorVerRegSearch" Root="HKLM" Key="SOFTWARE\Microsoft\Windows NT\CurrentVersion" Name="CurrentMajorVersionNumber" Type="raw" />
</Property>
<?define MinSystemName = "Windows 10, Windows Server 2016, or higher" ?>
<?define MinSystemCondition = "WINDOWSBUILDNUM" ?>
<?endif ?>
<Condition Message="This application is only supported on $(var.MinSystemName).">
<![CDATA[Installed OR $(var.MinSystemCondition)]]>
</Condition>
<Property Id="TRQTWINSTALLDIR" Secure="yes">

View File

@ -0,0 +1,98 @@
#!/usr/bin/env pwsh
$global:Qt5Version = '5.15.8'
$global:Qt5Deps = @(
'DBus'
'OpenSsl'
'Zlib'
)
function global:Build-Qt5([string] $PrefixDir, [string] $Arch, [string] $DepsPrefixDir) {
$Filename = "qt-everywhere-opensource-src-${Qt5Version}.zip" # tar.xz has some names truncated (e.g. .../double-conversion.h -> .../double-conv)
$Url = "http://qt.mirror.constant.com/archive/qt/$($Qt5Version -replace '\.\d+$', '')/${Qt5Version}/single/${Filename}"
$ArchiveBase = "qt-everywhere-src-${Qt5Version}"
$UnpackFlags = @(
(Join-Path $ArchiveBase qtactiveqt '*')
(Join-Path $ArchiveBase qtbase '*')
(Join-Path $ArchiveBase qtsvg '*')
(Join-Path $ArchiveBase qttools '*')
(Join-Path $ArchiveBase qttranslations '*')
(Join-Path $ArchiveBase qtwinextras '*')
(Join-Path $ArchiveBase .gitmodules)
(Join-Path $ArchiveBase configure.bat)
(Join-Path $ArchiveBase configure.json)
(Join-Path $ArchiveBase qt.pro)
)
$SourceDir = Invoke-DownloadAndUnpack $Url $Filename $UnpackFlags $ArchiveBase
$BuildDir = Join-Path $SourceDir .build
$ConfigOptions = @(
'-platform'; 'win32-msvc'
'-mp'
# '-ltcg' # error C1002 on VS 2019 16.5.4
'-opensource'
'-confirm-license'
'-prefix'; $PrefixDir
'-release'
'-force-debug-info'
'-dbus'
'-ssl'
'-openssl'
'-system-zlib'
'-qt-pcre'
'-qt-libpng'
'-qt-libjpeg'
'-no-opengl'
'-no-direct2d'
'-no-freetype'
'-no-harfbuzz'
'-no-sql-db2'
'-no-sql-ibase'
'-no-sql-mysql'
'-no-sql-oci'
'-no-sql-odbc'
'-no-sql-psql'
'-no-sql-sqlite'
'-no-sql-sqlite2'
'-no-sql-tds'
'-nomake'; 'examples'
'-nomake'; 'tests'
'-nomake'; 'tools'
'-I'; (Join-Path $DepsPrefixDir include)
'-L'; (Join-Path $DepsPrefixDir lib)
)
if ($env:LDFLAGS) {
# Patch to add our linker flags, mainly /PDBALTPATH
Edit-TextFile (Join-Path $SourceDir qtbase mkspecs win32-msvc qmake.conf) '(^QMAKE_CXXFLAGS\b.*)' "`$1`nQMAKE_LFLAGS += ${env:LDFLAGS}"
}
# No need in GUI tools
Edit-TextFile (Join-Path $SourceDir qttools src src.pro) 'qtHaveModule[(]gui[)]' 'qtHaveModule(hughey)'
Edit-TextFile (Join-Path $SourceDir qttools src src.pro) 'qtHaveModule[(]widgets[)]' 'qtHaveModule(digits)'
Edit-TextFile (Join-Path $SourceDir qttools src linguist linguist.pro) 'qtHaveModule[(]widgets[)]' 'qtHaveModule(digits)'
Invoke-NativeCommand cmake -E remove_directory $BuildDir
$env:PATH = @(
(Join-Path $PrefixDir bin)
(Join-Path $DepsPrefixDir bin)
(Join-Path $BuildDir qtbase lib)
$env:PATH
) -join [System.IO.Path]::PathSeparator
New-Item -Path $BuildDir -ItemType Directory -ErrorAction Ignore | Out-Null
Push-Location -Path $BuildDir
Invoke-VcEnvCommand (Join-Path $SourceDir configure) @ConfigOptions
Invoke-VcEnvCommand jom
Invoke-VcEnvCommand jom install
Pop-Location
# install target doesn't copy PDBs for release DLLs
Get-Childitem -Path (Join-Path $BuildDir qtbase lib) | `
ForEach-Object { if ($_ -is [System.IO.DirectoryInfo] -or $_.Name -like '*.pdb') { Copy-Item -Path $_.FullName -Destination (Join-Path $PrefixDir lib) -Filter '*.pdb' -Recurse -Force } }
Get-Childitem -Path (Join-Path $BuildDir qtbase plugins) | `
ForEach-Object { if ($_ -is [System.IO.DirectoryInfo] -or $_.Name -like '*.pdb') { Copy-Item -Path $_.FullName -Destination (Join-Path $PrefixDir plugins) -Filter '*.pdb' -Recurse -Force } }
}

View File

@ -1,18 +1,18 @@
#!/usr/bin/env pwsh
$global:QtVersion = '6.4.0'
$global:Qt6Version = '6.4.0'
$global:QtDeps = @(
$global:Qt6Deps = @(
'DBus'
'OpenSsl'
'Zlib'
)
function global:Build-Qt([string] $PrefixDir, [string] $Arch, [string] $DepsPrefixDir) {
$Filename = "qt-everywhere-src-${QtVersion}.zip" # tar.xz has some names truncated (e.g. .../double-conversion.h -> .../double-conv)
$Url = "http://qt.mirror.constant.com/archive/qt/$($QtVersion -replace '\.\d+$', '')/${QtVersion}/single/${Filename}"
function global:Build-Qt6([string] $PrefixDir, [string] $Arch, [string] $DepsPrefixDir) {
$Filename = "qt-everywhere-src-${Qt6Version}.zip" # tar.xz has some names truncated (e.g. .../double-conversion.h -> .../double-conv)
$Url = "http://qt.mirror.constant.com/archive/qt/$($Qt6Version -replace '\.\d+$', '')/${Qt6Version}/single/${Filename}"
$ArchiveBase = "qt-everywhere-src-${QtVersion}"
$ArchiveBase = "qt-everywhere-src-${Qt6Version}"
$UnpackFlags = @(
(Join-Path $ArchiveBase qtactiveqt '*')
(Join-Path $ArchiveBase qtbase '*')

View File

@ -1,6 +1,14 @@
#!/usr/bin/env pwsh
function global:Build-Transmission([string] $PrefixDir, [string] $Arch, [string] $DepsPrefixDir, [string] $SourceDir, [string] $ArtifactsDir, [boolean] $PackDebugSyms) {
function global:Build-Transmission(
[string] $PrefixDir,
[string] $Arch,
[string] $DepsPrefixDir,
[string] $SourceDir,
[string] $ArtifactsDir,
[string] $UseQtVersion,
[boolean] $PackDebugSyms
) {
$BuildDir = Join-Path $SourceDir .build
$env:PATH = @(
@ -37,11 +45,16 @@ function global:Build-Transmission([string] $PrefixDir, [string] $Arch, [string]
Copy-Item -Path (Join-Path $DepsPrefixDir bin "${x}.pdb") -Destination $DebugSymbolsDir
}
foreach ($x in @('Core', 'DBus', 'Gui', 'Network', 'Svg', 'Widgets')) {
$QtModules = @('Core', 'DBus', 'Gui', 'Network', 'Svg', 'Widgets')
if ($UseQtVersion -eq '5') {
$QtModules += @('WinExtras')
}
foreach ($x in $QtModules) {
if ($DepsPrefixDir -ne $PrefixDir) {
Copy-Item -Path (Join-Path $DepsPrefixDir bin "Qt6${x}.dll") -Destination (Join-Path $PrefixDir bin)
Copy-Item -Path (Join-Path $DepsPrefixDir bin "Qt${UseQtVersion}${x}.dll") -Destination (Join-Path $PrefixDir bin)
}
Copy-Item -Path (Join-Path $DepsPrefixDir bin "Qt6${x}.pdb") -Destination $DebugSymbolsDir
Copy-Item -Path (Join-Path $DepsPrefixDir bin "Qt${UseQtVersion}${x}.pdb") -Destination $DebugSymbolsDir
}
foreach ($x in @('gif', 'ico', 'jpeg', 'svg')) {
@ -52,12 +65,14 @@ function global:Build-Transmission([string] $PrefixDir, [string] $Arch, [string]
Copy-Item -Path (Join-Path $DepsPrefixDir plugins imageformats "q${x}.pdb") -Destination $DebugSymbolsDir
}
foreach ($x in @('openssl')) {
if ($DepsPrefixDir -ne $PrefixDir) {
New-Item -Path (Join-Path $PrefixDir plugins tls) -ItemType Directory -ErrorAction Ignore | Out-Null
Copy-Item -Path (Join-Path $DepsPrefixDir plugins tls "q${x}backend.dll") -Destination (Join-Path $PrefixDir plugins tls)
if ($UseQtVersion -eq '6') {
foreach ($x in @('openssl')) {
if ($DepsPrefixDir -ne $PrefixDir) {
New-Item -Path (Join-Path $PrefixDir plugins tls) -ItemType Directory -ErrorAction Ignore | Out-Null
Copy-Item -Path (Join-Path $DepsPrefixDir plugins tls "q${x}backend.dll") -Destination (Join-Path $PrefixDir plugins tls)
}
Copy-Item -Path (Join-Path $DepsPrefixDir plugins tls "q${x}backend.pdb") -Destination $DebugSymbolsDir
}
Copy-Item -Path (Join-Path $DepsPrefixDir plugins tls "q${x}backend.pdb") -Destination $DebugSymbolsDir
}
if ($DepsPrefixDir -ne $PrefixDir) {

View File

@ -17,6 +17,10 @@ Param(
[ValidateSet('None', 'All', 'Deps', 'App')]
[string] $CCachePart = 'None',
[Parameter()]
[ValidateSet('5', '6')]
[string] $UseQtVersion = '6',
[Parameter()]
[string] $SourceDir,
@ -71,7 +75,7 @@ function Invoke-Download([string] $Url, [string] $OutFile) {
}
}
function Invoke-DownloadAndUnpack([string] $Url, [string] $Filename, [string[]] $MoreFlags = @()) {
function Invoke-DownloadAndUnpack([string] $Url, [string] $Filename, [string[]] $MoreFlags = @(), [string] $ArchiveBase = '') {
New-Item -Path $CacheDir -ItemType Directory -ErrorAction Ignore | Out-Null
$ArchivePath = Join-Path $CacheDir $Filename
Invoke-Download $Url $ArchivePath
@ -86,7 +90,10 @@ function Invoke-DownloadAndUnpack([string] $Url, [string] $Filename, [string[]]
}
if ($ArchivePath -match '^(.+)(\.(tar|zip))$') {
$FinalArchivePath = Join-Path $TempDir (Split-Path -Path $Matches[1] -Leaf)
if ($ArchiveBase -eq '') {
$ArchiveBase = Split-Path -Path $Matches[1] -Leaf
}
$FinalArchivePath = Join-Path $TempDir $ArchiveBase
New-Item -Path $TempDir -ItemType Directory -ErrorAction Ignore | Out-Null
Push-Location -Path $TempDir
@ -257,7 +264,7 @@ if ($Mode -eq 'DepsHash') {
Invoke-Build Zlib -CacheArchiveNameOnly
Invoke-Build OpenSsl -CacheArchiveNameOnly
Invoke-Build Curl -CacheArchiveNameOnly
Invoke-Build Qt -CacheArchiveNameOnly
Invoke-Build Qt$UseQtVersion -CacheArchiveNameOnly
)
Write-Output (Get-StringHash ($Names -join ':'))
@ -284,7 +291,7 @@ if ($Mode -eq 'Build') {
Invoke-Build Zlib
Invoke-Build OpenSsl
Invoke-Build Curl
Invoke-Build Qt
Invoke-Build Qt$UseQtVersion
}
if (@('All', 'App') -contains $CCachePart) {
@ -296,7 +303,7 @@ if ($Mode -eq 'Build') {
}
if (@('All', 'App') -contains $BuildPart) {
Invoke-Build Transmission -NoCache -MoreArguments @($SourceDir, $SourceDir, $PackDebugSyms.IsPresent)
Invoke-Build Transmission -NoCache -MoreArguments @($SourceDir, $SourceDir, $UseQtVersion, $PackDebugSyms.IsPresent)
}
}